My Report

C# Programming Practice Test 9


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

1. Which of the following is not a namespace in the .NET Framework Class Library?

2. Which among the following is the correct statement about the using statement used in C#.NET?

3. What does the following method specify?

   public static WebRequest Create(string requestUriString)

4. Which of these data types can be used for a method having a return statement in it?

5. What is synchronization in reference to a thread?

6. Which of these methods return a largest whole number less than or equal to variable X?

7. Choose the correct statements for the following C# code?

 public System.Collections.IEnumerator GetEnumerator()
 {
     foreach (char ch in chrs)
     yield return ch;
 }

8. Which of these method returns a smallest whole number greater than or equal to variable X?

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

class equality 
{
    int x;
    int y;
    boolean isequal()
    {
        return(x == y);  
    } 
}    
class Output 
{
    public static void main(String args[]) 
    {
       equality obj = new equality();
       obj.x = 5;
       obj.y = 5;
       Console.WriteLine(obj.isequal());
    } 
}

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

class Program
{
    static void Main(string[] args)
    {
        double x = 3.14;  
        int y = (int) Math.Abs(x);
        Console.WriteLine(y);
    }
}

 

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.