1.
What is the output of the following .NET code:

using System;

class Program {
    static void Main(string[] args) {
        String a = "Hello World";
        int x = a.IndexOf('o');
        int y = a.LastIndexOf('l');
        Console.WriteLine(x + " " + y);
    }
}
2.
What is the output of the following .NET code:

using System;

class Program {
    static void Main(string[] args) {
        String s = "I like ice cream.";
        bool b = s.StartsWith("i");
        Console.WriteLine(b);
    }
}
3.
What is the output of the following C# code:

using System;

public class Program {

    public static void Main(String[] args) {
        char[] ar = {
            't', 'v', 'f'
        };
        String x = new String(ar);
        Console.WriteLine(x);
    }
}
4.
What is the output of the following code in C#:

using System;

public class Program {
    public static void Main(string[] args) {
        string a1 = "ollA";
        string a2 = "olla";
        if (a1 == a2)
            Console.WriteLine("Equal");
        else
            Console.WriteLine("Unequal");

        if (a1.Equals(a2))
            Console.WriteLine("Equal");
        else
            Console.WriteLine("Unequal");
    }
}
5.
What is the output of the following C# code:

using System;

public class Program {
    public static void Main(string[] args) {
        char[] cha = {
            'a', 'b', 'c'
        };
        String str = new String(cha);
        String str1 = "abcd";
        int length1 = str1.Length;
        int length2 = str.Length;
        Console.WriteLine(length1 + " " + length2);
        Console.ReadLine();
    }
}
6.
Which of the following commands is used to create an empty string object in .NET?
7.
What is the output of the following .NET code:

using System;

class Program {
    static void Main(string[] args) {
        String s = "Hello i love Csharp";
        Boolean var1 = s.StartsWith("hello");
        Console.WriteLine(var1);
    }
}
8.
What is the output of the following .NET code:

using System;

class MyClass {
    public int n1;
    private int n2;
    public void cal(int a, int b) {
        n1 = a + 1;
        n2 = b;
    }
}

class Program {
    static void Main(string[] args) {
        MyClass obj = new MyClass();
        obj.cal(2, 3);
        Console.WriteLine(obj.n1 + " " + obj.n2);
    }
}
9.
What is the output of the following .NET code:

using System;

class MyClass {
    public int x1;
    public int x2;
    public MyClass(int i, int j) {
        x1 = i;
        x2 = j;
    }
    public void calculate(MyClass o) {
        o.x1 *= 2;
        o.x2 /= 2;
    }
}

class Program {
    static void Main(string[] args) {
        MyClass obj = new MyClass(10, 20);
        obj.calculate(obj);
        Console.WriteLine(obj.x1 + " " + obj.x2);
    }
}
10.
What is the output of the following C# code:

using System;

class Program {
    static void Main(string[] args) {
        String s1 = "Hey sweety";
        String s2 = s1.Substring(0, 3);
        Console.WriteLine(s2);
    }
}