Ques 1 Break and Continue
What is output of the following code?
int main() { int k; for(i=0;k<5;k++) { printf("%d",k); break; printf("Label 1"); } printf("Label 2"); return 0; }
Ques 2 Break and Continue
What is output of the following code?
int main() { int k; do{ printf("%d",k); continue; i++; }while(k<=10); return 0; }
The given code contains an infinite loop because the continue statement is placed before the increment of the loop variable k. This means that the loop will keep printing the uninitialized value of k without making any progress.