By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,510 Members | 1,810 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,510 IT Pros & Developers. It's quick & easy.

Test the effect of continue statement in a for loop

P: 10
DOes anyone know how to get the answer to this?? Please Help me.

A simple way to to test the effect of a continue statement in the body of a for loop. What is printed?

for (putchar( ' 1 ' ); putchar( ' 2 ' ); putchar( ' 3 ' )) {
putchar( ' 4 ' );
continue;
putchar( ' 5 ' );
}
Nov 10 '06 #1
Share this Question
Share on Google+
1 Reply


sicarie
Expert Mod 2.5K+
P: 4,677
DOes anyone know how to get the answer to this?? Please Help me.

A simple way to to test the effect of a continue statement in the body of a for loop. What is printed?

for (putchar( ' 1 ' ); putchar( ' 2 ' ); putchar( ' 3 ' )) {
putchar( ' 4 ' );
continue;
putchar( ' 5 ' );
}
Just going out into a limb here, you could try to stick that into a compiler. I mean, it's not like you have to come up with any of the code... other than the header and the int main().
Nov 10 '06 #2

Post your reply

Sign in to post your reply or Sign up for a free account.