473,545 Members | 2,627 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Test the effect of continue statement in a for loop

10 New Member
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
1 1925
sicarie
4,677 Recognized Expert Moderator Specialist
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

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

Similar topics

5
2600
by: Glen Wheeler | last post by:
Hello All. I've been coding in python for a reasonable amount of time now (coding in total for approx. 20 years) and am writing a performance intensive program in python. The problem I'm having is I want to use break and continue to get out from more than one level of loop. If I set a variable and then check it my program will take too...
5
2528
by: Ann | last post by:
I have trouble sometimes figuring out where break and continue go to. Is there some easy way to figure it out, or a tool? TIA Ann
3
2043
by: Jianli Shen | last post by:
const DInst *stopAtDst = 0; while (dinst->hasPending()) { if (stopAtDst == dinst->getFirstPending()) break; ///////break? break? break? is this break outof the whole while loop and never in the loop again??????????????????????? DInst *dstReady = dinst->getNextPending();
6
2101
by: Roebie | last post by:
Hi everyone, I'm having some weird problem with evaluating the continue statement. Within a for loop I'm trying to evaluate a string (generated somewhere earlier) which basically has the continue statement in it. IE6 seems to have major problems with that as it generates an error "Can't have 'continue' outside of loop". Does anyone know why...
4
4657
by: Christopher Benson-Manica | last post by:
Given the following snippet, int i; for( i=0 ; i < 10 ; i++ ) { switch( i ) { case 0: case 1: continue; /* NB */ default: /* do something */
15
9133
by: PagCal | last post by:
Is this language missing the functionality of a C/C++ 'continue' statement? For example: While NOT isEof() If condition ' a C or C++ continue would work here ' but we are forced to use a GoTo GoTo nxt End If
25
18359
by: v4vijayakumar | last post by:
'continue' within switch actually associated with the outer 'while' loop. Is this behavior protable? int ch = '\n'; while (true) { switch(ch) { case '\n': cout << "test"; continue; } }
14
19398
by: Jan Schmidt | last post by:
Hi, in a nested do-while-loop structure I would like to "continue" the outer loop. With goto this should be no problem in while-loops. However, for do-while I cannot get it to work (without a strange workaround construct): -- do { // ...
36
2622
by: mdh | last post by:
May I ask the group this somewhat non-focused question....having now seen "continue" used in some of the solutions I have worked on. ( Ex 7-4 solution by Tondo and Gimpel comes to mind) Is there a good principle/s for the good usage of "continue"...or...do any of the regular/irregular contributors have a "favorite" way in which it is...
0
7496
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7941
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
7784
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6014
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5354
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5071
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3467
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1916
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
738
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.