Knowee
Questions
Features
Study Tools

hat will be the output of the following C code?#include <stdio.h>void main(){int i = 10;if (i == 10){printf("Hello");continue;}

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;}

🧐 Not the exact question you are looking for?Go ask a question

Solution

The code you provided will not compile successfully. The reason is that the continue statement is used inside an if statement. The continue statement is used inside loops (for, while, do-while) to skip the current iteration and move to the next one. It is not valid inside an if statement.

If you remove the continue statement, the code will print "Hello" because the condition i == 10 is true.

This problem has been solved

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

1/4

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.