A loop similar to do while loop?

Is there any loop that can repeat a program without the user having to enter yes or no to decide whether the program loops again?
Heres a page that teaches you about loops, it's quite nice.
http://www.cplusplus.com/doc/tutorial/control/


I assume you could have a do-while loop like this
1
2
3
4
do {

}
while(variable == 1) 


And have 'variable' always be 1, i.e never change.
Last edited on
All loops, though typically you want the loop to end at some point:
1
2
3
// Infinite loop
while (true)
  ;

Thanks Terje :D
Topic archived. No new replies allowed.