hat will be the output of the following C code?#include <stdio.h>void main(){int i = 10;if (i == 10){printf("Hello");continue;}}hello infinite timeshello 10 timeshelloCompile time erro
Question
hat will be the output of the following C code?#include <stdio.h>void main(){int i = 10;if (i == 10){printf("Hello");continue;}}hello infinite timeshello 10 timeshelloCompile time erro
Solution
The output of the given C code will be a compile-time error. The reason is that the 'continue' statement is used inside an 'if' statement, which is not inside any loop. The 'continue' statement in C is used to skip the rest of the current loop iteration and immediately start the next iteration. It should be used inside a loop only (like 'for', 'while', 'do-while'), not directly inside an 'if' statement.
Similar Questions
hat will be the output of the following C code?#include <stdio.h>void main(){int i = 10;if (i == 10){printf("Hello");continue;}
What will be the output of the following C code?
what will be the output of the c program?
hat will be the output of the following code snippet?123456#include <stdio.h>int main() { int num = 20; printf("%d", num >= 20 && num <= 30); return 0;}
hat will be the output of the following C code?#include <stdio.h>void main(){int i = 10;if (i == 10){printf("Hello");continue;}}hello infinite timeshello 10 timeshelloCompile time erro
Upgrade your grade with Knowee
Get personalized homework help. Review tough concepts in more detail, or go deeper into your topic by exploring other relevant questions.