Q:
What will be output of following c code?
#include <stdio.h>
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;
}
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.
View answer
Workspace
Report Error
Discuss