Question discussion

Which of the following is the correct syntax of an if-else statement in C?

359033Medium DSSSB TGT Computer Science 0 replies 0 views
0
Which of the following is the correct syntax of an if-else statement in C?
  • Aif (condition) { statements } else { statements }
  • Bif (condition) then { statements } else { statements }
  • Cif [condition] then { statements } else { statements }
  • Dif condition: statements else: statements
Correct answer: A

Explanation

The C syntax is if (condition) { statements } else { statements }. C has no "then" keyword.

Discussion 0

Nobody has replied yet. Start the discussion!