hi, i'm new to c++(just 3 days) and new to this forum too (so pls go easy on me). my problem is i can't remember how to use the for, while and do loops. but when i see a program with these loops in them i completely understand the program but can't write one cuz i keep forgeting how it's done. is there any "method" or "trick" you guys use to remember them? and if it's just that i need more practice can you link me to a site that has a bunch of "worked" examples and exercises?
thanks!
mikki2
0
Junior Poster in Training
Recommended Answers
Jump to PostA
for()
loop is best used when you know (either based on a variable's value, or a set number) how many times a loop should run. For example, if I wanted to have a message printed exactly 5 times, I would do this:for(int …
Jump to Postbut i have changed a few things in it just for practice but it keeps saying "switch quantity not". i dont know what that means...any help?
double operand; // ... switch (operand) { case "C": // ...
"switch quantity not an integer"? You can't use a switch with …
All 6 Replies
Jessehk
20
Newbie Poster
msaqib
-3
Junior Poster in Training
mikki2
0
Junior Poster in Training
Dave Sinkula
2,398
long time no c
Team Colleague
mikki2
0
Junior Poster in Training
Dave Sinkula
2,398
long time no c
Team Colleague
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.