logo

CuriousTab

CuriousTab

Discussion


Home C# Programming Control Instructions See What Others Are Saying!
  • Question
  • Which of the following statements are correct?

    1. The switch statement is a control statement that handles multiple selections and enumerations by passing control to one of the case statements within its body.
    2. The goto statement passes control to the next iteration of the enclosing iteration statement in which it appears.
    3. Branching is performed using jump statements which cause an immediate transfer of the program control.
    4. A common use of continue is to transfer control to a specific switch-case label or the default label in a switch statement.
    5. The do statement executes a statement or a block of statements enclosed in {} repeatedly until a specified expression evaluates to false.


  • Options
  • A. 1, 2, 4
  • B. 1, 3, 5
  • C. 2, 3, 4
  • D. 3, 4, 5
  • E. None of these

  • Correct Answer
  • 1, 3, 5 


  • More questions

    • 1. There is no private or protected inheritance in C#.NET.

    • Options
    • A. True
    • B. False
    • Discuss
    • 2. Which of the following is NOT an Arithmetic operator in C#.NET?

    • Options
    • A. **
    • B. +
    • C. /
    • D. %
    • E. *
    • Discuss
    • 3. The space required for structure variables is allocated on stack.

    • Options
    • A. True
    • B. False
    • Discuss
    • 4. Is it possible to invoke Garbage Collector explicitly?

    • Options
    • A. Yes
    • B. No
    • Discuss
    • 5. It possible to create a custom attribute that can be applied only to specific programming element(s) like ____ .

    • Options
    • A. Classes
    • B. Methods
    • C. Classes and Methods
    • D. Classes, Methods and Member-Variables
    • Discuss
    • 6. C#.NET structures are always value types.

    • Options
    • A. True
    • B. False
    • Discuss
    • 7. What does the following C#.NET code snippet will print?

      int i = 0, j = 0; 
      
      label:
          i++;
          j+=i;
      if (i < 10)
      {
          Console.Write(i +" ");
          goto label; 
      }

    • Options
    • A. Prints 1 to 9
    • B. Prints 0 to 8
    • C. Prints 2 to 8
    • D. Prints 2 to 9
    • E. Compile error at label:.
    • Discuss
    • 8. The [Serializable()] attribute gets inspected at

    • Options
    • A. Compile-time
    • B. Run-time
    • C. Design-time
    • D. Linking-time
    • E. None of the above
    • Discuss
    • 9. Code that targets the Common Language Runtime is known as

    • Options
    • A. Unmanaged
    • B. Distributed
    • C. Legacy
    • D. Managed Code
    • E. Native Code
    • Discuss
    • 10. Which of the following are the correct ways to declare a delegate for calling the function func() defined in the sample class given below?

      class Sample
      {
          public int func(int i, Single j)
          {
              /* Add code here. */
          }
      }

    • Options
    • A. delegate d(int i, Single j);
    • B. delegate void d(int, Single);
    • C. delegate int d(int i, Single j);
    • D. delegate void (int i, Single j);
    • E. delegate int sample.func(int i, Single j);
    • Discuss


    Comments

    There are no comments.

Enter a new Comment