Find the output from following program? int main() { int a = 10, b; a > =5 ?…
Find the output from following program?
int main()
{
int a = 10, b;
a > =5 ? b=100: b=200;
printf("%d\n", b);
return 0;
}
Answer: A. 100 — a = 10 Condition: a >= 5 → true So, b = 100 Therefore, output is: 100
- A.
100
- B.
200
- C.
Error: L value required for b
- D.
Garbage value
Attempted by 35 students.
Show answer & explanation
Correct answer: A
a = 10
Condition:
a >= 5 → true
So,
b = 100
Therefore, output is:
100
Loading lesson…