Home » C Programming » Control Instructions

Point out the error, if any in the while loop. #include int main() { int i=1; while() { printf("%d\n", i++); if(i>10) break; } return 0; }

Correct Answer: There should be a condition in the while loop

Explanation:

The while() loop must have conditional expression or it shows "Expression syntax" error.


Example: while(i > 10){ ... }


← Previous Question Next Question→

More Questions from Control Instructions

Discussion & Comments

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