Home » C Programming » Control Instructions

Point out the error, if any in the program. #include int main() { int a = 10, b; a >=5? b=100: b=200; printf("%d\n", b); return 0; }

Correct Answer: Error: L value required for b

Explanation:

Variable b is not assigned.


It should be like:
b = a >= 5 ? 100 : 200;


← Previous Question Next Question→

More Questions from Control Instructions

Discussion & Comments

No comments yet. Be the first to comment!
Join Discussion