1.
In C#, what is the output of the following code?
public class Program {
    public static void Main(string[] args)

    {
        string s1 = " i move on";
        Console.WriteLine(s1.IndexOf('m') + " " + s1.LastIndexOf('o') + " " + s1.IndexOf('e'));
        Console.ReadLine();
    }
}
2.
In C#, what is the output of the following code?
class Program {
    static void Main(string[] args) {
        char[] arr = {
            'p', 'q', 'r'
        };
        String s = new String(arr);
        Console.WriteLine(s);
        Console.ReadLine();
    }
}
3.
In C#, what is the output of the following code?

using System;
using System.Text;
class value {
    static void Main(string[] args) {
        String s1 = "Hello i like .net";
        StringBuilder s2 = new StringBuilder(s1);
        Console.WriteLine(s1.Equals(s2));
        Console.ReadLine();
    }
}
4.
In C#, what is the output of the following code?
class access {
    public int r1;
    private int r2;
    public void cal(int a, int b) {
        r1 = a + 1;
        r2 = b;
    }
    public void print() {
        Console.WriteLine(" " + r2);
    }
}
class Program {
    static void Main(string[] args) {
        access obj = new access();
        obj.cal(2, 3);
        Console.WriteLine(obj.r1);
        obj.print();
        Console.ReadLine();
    }
}
5.
In C#, what is the output of the following code?
class myClass {
    public int x;
    private int y;
    public void cal(int x1, int x2) {
        x = x1 + 1;
        y = x2;
    }
    public void print() {
        Console.WriteLine(" " + y);
    }
}
class Program {
    static void Main(string[] args) {
        myClass obj = new myClass();
        obj.cal(2, 3);
        Console.WriteLine(obj.x);
        obj.print();
        Console.ReadLine();
    }
}
6.
What is the output of the following .NET code:

using System;

class Test {
    unsafe static void Main() {
        int * ptrs = stackalloc int[3];
        ptrs[0] = 1;
        ptrs[1] = 2;
        ptrs[2] = 3;
        for (int j = 2; j >= 0; --j) {
            ptrs[j] = ptrs[j] * 3;
            ptrs[j] = ptrs[j] + 4;
            Console.Write(ptrs[j] + " ");
        }
    }
}
7.
What is the output of the following .NET code:

using System;

class Test {
    unsafe static void Main() {
        char[] arr = {
            'T', 'U', 'V', 'W', 'X'
        };
        fixed(char * z = arr) {
            int j;
            for (j = 0; j < 5; j++)
                if ( * z % 2 == 0)
                    ++ * z;
                else
                    ( * z) ++;
            Console.WriteLine(arr);
        }
    }
}
8.
What is the output of the following .NET code:

using System;

class Test {
    unsafe static void Main() {
        int z = 10;
        void * b = & z;
        Console.WriteLine( * b);
    }
}
9.
What is the output of the following .NET code:
using System;

class Program {
    unsafe static void Main() {
        int * z;
        z = (int * )(65535);
        Console.WriteLine((uint) z);
    }
}
10.
In C#, what is the output of the following code?

public class Generic {
    Stack s = new Stack();
    public void push(S obj) {
        s.Push(obj);
    }
    public S pop() {
        S obj = s.Pop();
        return obj;
    }
}
class Program {
    static void Main(string[] args) {
        Generic k = new Generic();
        k.push("Csharp");
        Console.WriteLine(k.pop());
        Console.ReadLine();
    }
}