Home » Technical Questions » Programming

What will be output of following c code? #include int main() { int i; for(i=10;i<=15;i++){ while(i){ do{ printf("%d ",1); if(i>1) continue; }while(0); break; } } return 0; }

Correct Answer: Output: 1 1 1 1 1 1 For loop will execute six times Note: continue keyword in do-while loop bring the program its while condition (while(0)) which is always false

← Previous Question Next Question→

Discussion & Comments

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