Goto statement
Wed Jun 08 2022 05:18:28 GMT+0000 (Coordinated Universal Time)
Saved by
@KanishqJ8
// int main() {
// label:
// printf("we are inside label\n");
// goto end;
// printf("hello world\n");
// goto label;
// end:
// printf("we are at end");
// return 0;
// }
int main(){
int num;
for(int i=0; i<8; i++){
printf("%d\n",i);
for(int j=0; j<8; j++){
printf("enter the number. enter 0 to exit\n");
scanf("%d",&num);
if(num==0){
goto end;
}
}
}
end:
return 0;
}
content_copyCOPY
Comments