Question 11
Consider the below C program.
#include <stdio.h>
int main() { int a = 10, b = 20; int c = b > a ? b-5 : a+2; printf("%d",c); return 0;}What will be the output of the above program?
5
10
15
20
Consider the below C program.
#include <stdio.h>
int main() { int a = 10, b = 20; int c = b > a ? b-5 : a+2; printf("%d",c); return 0;}What will be the output of the above program?
5
10
15
20
Correct answer
15
Question 11 of 16 in the IIT Madras BS Introduction to C Programming (Intro to C Programming) Qualifier paper sat on 16 Mar 2025, in the January 2025 term (IIT M ES QUALIFIER AN EXAM QEQ1 16 Mar 2025). It carries 3 marks.