What will be the output of the following code? int main() {
What will be the output of the following code?
#include <stdio.h>
int main() {
int a = 10, b = 20;
int max = (a > b) ? a : b;
printf("%d", max);
return 0;
}
Show answerHide answer
Correct answer: (D) 20
Explanation
a > b (10 > 20) is false, so the conditional operator returns b, and 20 is printed.