What is the correct syntax for do while loop in C#?

41. What is the correct syntax for do while loop in C#?

  1. do; {
     statement(s);
    } while (test_condition);
    
  2. do
    {
     statement(s);
    } while (test_condition)
    
  3. do(test_condition) {
    statement(s);
    }while;
    
  4. do {
     statement(s);
    } while (test_condition);
    

Answer: D)

do {
 statement(s);
} while (test_condition);

Explanation:

The correct syntax of do...while statement is:

do {
 statement(s);
} while (test_condition);

Comments and Discussions!

Load comments ↻






Copyright © 2024 www.includehelp.com. All rights reserved.