C# Programming Trivia: Quiz!

9 Questions | Total Attempts: 59

SettingsSettingsSettings
Please wait...
C# Programming Trivia: Quiz!

.


Questions and Answers
  • 1. 
    Can multiple catch blocks be executed?
    • A. 

      Yes

    • B. 

      No

  • 2. 
    A=(5>6)?8:10 Consol.Writeline(a); what would be the output of this statement is a conditional statement.
  • 3. 
    What actually manages your code?
    • A. 

      JIT

    • B. 

      CTS

    • C. 

      CLR

    • D. 

      CLS

  • 4. 
    Just-in-Time (JIT) Compilation: This is the term for the process of performing the ___ stage of compilation from IL into native machine code.
    • A. 

      INTERMEDIATE

    • B. 

      BEGINNING

    • C. 

      FINAL

    • D. 

      WHOLE

  • 5. 
    Using System; class emp { public string name; public string address; public void display() { Console.WriteLine("{0} is in city {1}", name, address); } } class Program { static void Main(string[] args) { emp obj = new emp(); obj.name = "Akshay"; obj.address = "new delhi"; obj.display(); Console.ReadLine(); } }
    • A. 

      Syntax error

    • B. 

      {0} is in city {1} Akshay new delhi

    • C. 

      Akshay is in new delhi

    • D. 

      Akshay is in city new delhi

    • E. 

      Executes successfully and prints nothing

  • 6. 
    Shape obj; obj = new shape();
    • A. 

      Creates an object of class shape.

    • B. 

      To create an object of type shape on the heap or stack depending on its size.

    • C. 

      Create a reference obj of the class shape and an object of type shape on the heap.

    • D. 

      Create an object of type shape on the stack.

  • 7. 
    Using System; class sample { public static void first() { Console.WriteLine("first method"); } public void second() { first(); Console.WriteLine("second method"); } public void second(int i) { Console.WriteLine(i); second(); } } class program { public static void Main() { sample obj = new sample(); sample.first(); obj.second(10); } }
    • A. 

      Second method 10 second method first method

    • B. 

      First method 10 first method second method

    • C. 

      First method 10

    • D. 

      Second method 10 first method.

  • 8. 
    Using System; class program { static void Main(string[] args) { int num = 2; fun1 (ref num); Console.WriteLine(num); Console.ReadLine(); } static void fun1(ref int num) { num = num * num * num; } }
    • A. 

      8

    • B. 

      0

    • C. 

      2

    • D. 

      16

  • 9. 
    Using System; class program { static void Main(string[] args) { int x = 8; int b = 16; int c = 64; x /= c /= b; Console.WriteLine(x + " " + b+ " " +c); Console.ReadLine(); } }
    • A. 

      2 16 4

    • B. 

      4 8 16

    • C. 

      2 4 8

    • D. 

      8 16 64

Back to Top Back to top