Skip to content
Related Articles
Open in App
Not now

Related Articles

ISRO | ISRO CS 2011 | Question 63

Improve Article
Save Article
  • Last Updated : 11 May, 2018
Improve Article
Save Article

What is the output of the following C code?

#include 
int main()
{
int index;
for(index=1; index<=5; index++)
{
printf("%d", index);
if (index==3)
continue;
}
}

(A) 1245
(B) 12345
(C) 12245
(D) 12354


Answer: (B)

Explanation: The continue statement forces the loop to continue or execute the next iteration. When the continue statement is executed in the loop, the code inside the loop following the continue statement will be skipped and next iteration of the loop will begin.

In this code, continue statement do not contain any loop or statement so basically there would be no effect on the execution of the program.
So, the code will print 12345.

Option (B) is correct.

Quiz of this Question

My Personal Notes arrow_drop_up
Related Articles

Start Your Coding Journey Now!