0
what would happen if i put "num = num -1;" in this cycle
int num = 1; while (num < 6) { cout << "Number: " << num << endl; num = num + 1; }
1 Respuesta
0
Congratulations! You just have created an infinite loop! Since your statement (num < 6) ALWAYS will be true, the program will print infinite numbers. I don't recommend doing that, by the way...