My Report

C# Programming Mock Test 10


Correct Answer: 2 points | Wrong: -1 point
Grades: A* (100% score) | A (80%-99%) | B (60%-80%) | C (40%-60%) | D (0%-40%)
advertisement
 10%

Question 1 of 10

1. Which of these classes is used to create servers that listen to either local or remote client programs?

Question 1 of 10

Question 2 of 10

2. What is the value returned by the function CompareTo() if the invoking string is less than the string compared?

Question 2 of 10

Question 3 of 10

3. What will be the output of the following C# code snippet?

 class sum   
 {
     public int x;
     public int y;
     public  int add (int a, int b)
    {
        x = a + b;
        y = x + b;
        return 0;
    }
}    
class Program
{
    static void Main(string[] args)
    {
        sum obj1 = new sum();
        sum obj2 = new sum();   
        int a = 2;
        obj1.add(a, a + 1);
        obj2.add(5, a);
        Console.WriteLine(obj1.x + "  " + obj2.y);     
        Console.ReadLine();
    }
}

Question 3 of 10

Question 4 of 10

4. Select the type argument of open constructed type?

Question 4 of 10

Question 5 of 10

5. What will be the output of the following C# code snippet?

 class Program
 {
     static void Main(string[] args)
     {
         String s1 = "Hello World";
         String s2 = s1.Substring(0, 4);
         Console.WriteLine(s2);
         Console.ReadLine();
     }
 }

Question 5 of 10

Question 6 of 10

6. Choose the base class for string() method.

Question 6 of 10

Question 7 of 10

7. Which of the following job is done by the instruction ++*p for an integer pointer p?

Question 7 of 10

Question 8 of 10

8. 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!");
    }
}

Question 8 of 10

Question 9 of 10

9. Choose the exceptions generated by the GetResponseStream() method defined by WebRequest.

Question 9 of 10

Question 10 of 10

10. Which among the given operators is referred to as 'address of' operator?

Question 10 of 10


 

Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & discussions at Telegram SanfoundryClasses.