| zech5443 (2) | |
|
what will happen to this code? is it this code will become infinite loop? int i=2; while ( i<6); { cout << "some even : " << i << i+2 << i+4 << endl; ++i; } | |
|
|
|
| FredFlintstone (11) | |||
while (i <6);'re executing an empty while i <6 (always) delete the semicolon.
| |||
|
|
|||
| jumper007 (361) | ||||
The code will loop for 4 times:
If you want it to print only even numbers, you have to change the code. ~ Raul ~ | ||||
|
Last edited on
|
||||
| zech5443 (2) | |
| oh ic, thank you, to both of you! ^^ | |
|
|
|