My Report

C# Programming Mock Test 7


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. 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 1 of 10

Question 2 of 10

2. Which of the following is the correct way to call the function abc() of the given class in the following C# code?

class csharp
{
    public int abc(int a)
    {
        Console.WriteLine("A:Just do it!");
        return 0;
    }
}

Question 2 of 10

Question 3 of 10

3. Choose the filemode method which is used to create a new output file with the condition that the file with same name if exists will destroy the old file:

Question 3 of 10

Question 4 of 10

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

 static void Main(string[] args)
 {
     Console.Write("c");
     Console.Write("sharp" );
     Console.ReadLine();
 }

Question 4 of 10

Question 5 of 10

5. To generate a simple notification for an object in runtime, the programming construct to be used for implementing this idea?

Question 5 of 10

Question 6 of 10

6. Choose the statements which makes delegate in C#.NET different from a normal class?

Question 6 of 10

Question 7 of 10

7. Which among the following differentiates a delegate in C#.NET from a conventional function pointer in other languages?

Question 7 of 10

Question 8 of 10

8. Which of these is a method used for reading bytes from the file?

Question 8 of 10

Question 9 of 10

9. What will be the output for following input from the console as a character?

 static void Main(string[] args)
 {
     Console.WriteLine("what is your name?");
     char s;
     s = Convert.ToChar(Console.ReadLine());
     Console.WriteLine("how are you: "+s);
     Console.Read();
 }

Question 9 of 10

Question 10 of 10

10. Select the action of the method long seek()?

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.