Multiple choice technology programming languages

What will be the output of the following program : void main() { int a=5; int b=6;; int c=a+b; printf("%d",c); }

  1. Compile-Time Error

  2. Run-Time Error

  3. 11

  4. None of above

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

The semicolon ';' is a statement terminator in C, not an operator. Having two semicolons 'int b=6;;' is valid - the second semicolon just creates an empty statement. The program correctly computes c = 5 + 6 = 11 and prints it.