1.
In ASP.NET, which of the following is not a component of a web form?
2.
Which of these is not true about the .NET framework:
  1. It provides a consistent object-oriented programming environment whether the object code is stored and executed locally yet web-distributed, or executed remotely.
  2. It provides a code-execution environment that minimizes software deployment and version conflicts.
  3. It provides a code-execution environment that promotes the safe execution of code, including the code created by an unknown or semi-trusted third party.
  4. It provides different programming models for Windows-based applications and web-based applications.
  5. It provides an event-driven programming model for building Windows Device Drivers.
3.
How is a jagged array declared in C#?
4.
What is the output of the following C# code:

using System;
class Program {
    static void Main(string[] args) {
        int[] a1 = {
            1, 2, 3, 4
        };
        int[] a2 = (int[]) a1.Clone();
        a2[1] = 5;
        a2[2] = 6;
        int[] a3 = new int[4];
        Array.Copy(a2, a1, 3);
        Console.WriteLine(a1[1]);
        Console.Read();
    }
}
5.
What is the output of the following C# code:
using System;
class Program {
    static void Main() {
        int n;
        n = 4;
        fun(n, 0, 1);
        Console.Read();
    }

    static void fun(int n, int a, int b) {
        if (n <= 0)
            return;
        Console.Write("{0} ", a);
        fun(--n, b, 1 + a + b);
    }
}
6.
What is the output of the following .NET code:

using System;

class Program {
    static void Main(string[] args) {
        string s1 = "Ind";
        string s2 = s1.Insert(2, "i");
        string s3 = s2.Insert(4, "o");
        for (int i = 0; i < s3.Length; i++)
            Console.Write(s3[i]);
    }
}
7.
What is the output of the following C# code:
using System;

class A {
    int i;
    int j;
    public A() {
        i = 1;
        j = 2;
    }
}

class Program {
    static void Main(string[] args) {
        A a = new A();
        Console.WriteLine(a.ToString());
    }
}
8.
What is the output of the following C# code:

using System;
using System.Numerics;

class Sum {
    public int r1;
    public int r2;
    public int add(int x1, int x2) {
        r1 = x1 + x2;
        r2 = r1 + x2;
        return 0;
    }
}

class Program {
    static void Main(string[] args) {
        Sum obj1 = new Sum();
        Sum obj2 = new Sum();
        int x1 = 2;
        obj1.add(x1, x1 + 1);
        obj2.add(5, x1);
        Console.WriteLine(obj1.r1 + " " + obj2.r2);
        Console.ReadLine();
    }
}
9.
What is the output of the following .NET code:

using System;

class MyClass {
    public static int r1;
    public static int r2;
    public void update(int x1, int x2) {
        r1 = x1 + x2;
        r2 = r1 + x2;
    }
}

class Program {
    static void Main(string[] args) {
        MyClass obj1 = new MyClass();
        MyClass obj2 = new MyClass();

        int x1 = 2;
        obj1.update(x1, x1 + 1);
        obj2.update(5, x1);

        Console.WriteLine(MyClass.r1 + " " + MyClass.r2);
    }
}
10.
What is the output of the following .NET code:

using System;

class UnsafeCode {
    struct MyStruct {
        public int x1;
        public int x2;
        public int Sum() {
            return x1 * x2;
        }
    }

    unsafe static void Main() {
        MyStruct o = new MyStruct();
        MyStruct * q;
        q = & o;
        q - > x1 = 10;
        q - > x2 = 20;
        Console.WriteLine("Value is " + q - > Sum());
    }
}