GoConqr has a new look! Let us know what you think.

Quiz

C# 1

José Kappert 40 questions

Take the quiz

This quiz has question types that open in the usual player.

Questions in this quiz (40)

  1. 1The [blank_start]switch[blank_end] statement selects for execution a statement list having an associated label
    that corresponds to the value of an expression
    1. Aswitch
  2. 2Write the following code snippet:
    int n = 20;
    int d = n 5;
    What will be the value of d after this code snippet is executed?
    1. A25
    2. B26
    3. C27
    4. D28
  3. 3The [blank_start]do-while[blank_end] loop tests the condition at the bottom of the loop instead of at the top.
    1. Ado-while
  4. 4 Write the following code snippet:
    private static void WhileTest()
    {
    int i = 1;
    while (i < 5)
    {
    Console.WriteLine(“The value of i = {0}”, i);
    i;
    }
    }
    How many times will the while loop be executed in this code snippet?
    1. A0
    2. B1
    3. C4
    4. D5
  5. 5The only operator that takes three arguments is the [blank_start]?:[blank_end] operator
    1. A?:
  6. 6Write the following code snippet:
    int number1 = 10;
    int number2 = 20;
    if (number2 > number1)
    Console.WriteLine(“number1”);
    Console.WriteLine(“number2”);
    What output will be displayed after this code snippet is executed?
    1. Anumber1
    2. Bnumber2
    3. Cnumber1
      number2
    4. Dnumber2
      number1
  7. 7The [blank_start]foreach[blank_end] loop is the most compact way to iterate through the items in a collection.
    1. Aforeach
  8. 8In a switch statement, if none of the case statements match the switch expression, then
    control is transferred to which statement?
    1. Abreak
    2. Bcontinue
    3. Cdefault
    4. Dreturn
  9. 9On a 32-bit computer, a variable of int data type takes [blank_start]four[blank_end] bytes of memory
    1. Afour
  10. 10You need to write code that closes a connection to a database, and you need to make
    sure this code is always executed regardless of whether an exception is thrown. Where
    should you write this code?
    1. AWithin a try block
    2. BWithin a catch block
    3. CWithin a finally block
    4. DWithin the Main method

Information

Description
Information Technology Quiz on C# 1, created by José Kappert on 19/06/2017.
Language
English
Views
5
Rating
No ratings yet
Rate this quiz
Rate this quiz

Feedback

What is it about?

What do you think of the new look?

How do you like it?