51.
What will be the output of the following C# code?
{
 delegate string f(string str);
 class sample
 {
     public static string fun(string a)
     {
         return a.Replace('k', 'o');
     }
 }
 class Program
 {
     static void Main(string[] args)
     {
         f str1 = new f(sample.fun);
         string str = str1("Test Ykur C#.NET Skills");
         Console.WriteLine(str);
         Console.ReadLine();
     }
 }
}

53.
What will be the output of the following C# code snippet?
public class Generic<T>
{
    Stack<T> stk = new Stack<T>();
    public void push(T obj)
    {
        stk.Push(obj);
    }
    public T pop()
    {
        T obj = stk.Pop();
        return obj;
    }
}
class Program
{
    static void Main(string[] args)
    {
        Generic<int> g = new Generic<int>();
        g.push("Csharp");
        Console.WriteLine(g.pop());
        Console.ReadLine();
    }
}

54.
In the following C# code, which of the following statements are perfectly valid?
public class MyContainer<T> where T: IComparable
{
  /* insert code here */
}

55.
Choose the correct way to call subroutine fun() of the sample class?
class a
{
    public void x(int p, double k)
    {
        Console.WriteLine("k : csharp!");
    }
}

delegate void del(int i);
x s = new x();
del d = new del(ref s.x);
d(8, 2.2f);

delegate void del(int p,  double k);
del d;
x s = new x();
d = new del(ref s.x);
d(8, 2.2f);

x s = new x();
delegate void d = new del(ref x);
d(8, 2.2f);

56.
Which of these is a correct way of defining generic method?

57.
What will be the output of the following C# code snippet?
public class Generic<T>
{
    Stack<T> stk = new Stack<T>();
    public void push(T obj)
    {
        stk.Push(obj);
    }
    public T pop()
    {
        T obj = stk.Pop();
        return obj;
    }
}
class Program
{
    static void Main(string[] args)
    {
        Generic<int> g = new Generic<int>();
        g.push("Csharp");
        Console.WriteLine(g.pop());
        Console.ReadLine();
    }
}

58.
In the following C# code, which statements are perfectly valid?
public class Csharp
{
    public void subject<S>(S arg)
    {
        Console.WriteLine(arg);
    }
}
class Program
{
    static Void Main(string[] args)
    {
        Csharp c = new Csharp();
        c.subject("hi");
        c.subject(20);
    }
}

59.
What will be the output of the following C# code snippet?
public class Generic<T>
{
    Stack<T> stk = new Stack<T>();
    public void push(T obj)
    {
        stk.Push(obj);
    }
    public T pop()
    {
        T obj = stk.Pop();
        return obj;
    }
}
class Program
{
    static void Main(string[] args)
    {
        Generic<string> g = new Generic<string>();
        g.push("C++");
        Console.WriteLine(g.pop() + " ");
        Generic<int> g1 = new Generic<int>();
        g1.push(20);
        Console.WriteLine(g1.pop());
        Console.ReadLine();
    }
}

60.
Choose the advantages of using generics?