Question discussion

What will be the output of the following code?

359037Medium DSSSB TGT Computer Science 0 replies 0 views
0
What will be the output of the following code?
#include <stdio.h>
int main() {
    if (5 > 10)
        printf("5 is greater than 10");
    else
        printf("5 is not greater than 10");
    return 0;
}
  • ANo output
  • BSyntax error
  • C5 is greater than 10
  • D5 is not greater than 10
Correct answer: D

Explanation

5 > 10 is false, so the else part prints "5 is not greater than 10".

Discussion 0

Nobody has replied yet. Start the discussion!