Looping | Sololearn: Learn to code for FREE!

0

Looping

BUG BUSTERS: What is wrong with this code? int counter = 0; while (counter < 10) { cout << “counter: “ << counter; }

c++

11/10/2016 3:07:20 PM

Rabbi Sarpong

1 Answer

New Answer

+2

0 You don`t have "counter" to increment and then your code will be infinite loop. Correct Answer : int counter = 0; while (counter < 10) { cout << “counter: “ << counter; counter++; } Hope to help you!