+ 3

Why is the iteration continuing

Why is the output produced multiple no. Of times? https://code.sololearn.com/cs8lGahyzm1V/?ref=app

6th Sep 2020, 3:09 PM
P. Aamir
P. Aamir - avatar
3 ответов
+ 1
Why do you put your statements in a While loop? Look at this example without using loops https://code.sololearn.com/c38e64Henh9G/#cpp
6th Sep 2020, 4:27 PM
Martín Santiago
Martín Santiago - avatar
6th Sep 2020, 4:48 PM
P. Aamir
P. Aamir - avatar
0
As you used while looping, it will continue until you enter 0. Your condition to stop loop is miles!=0 So Revise your learning about loops to understand it..
6th Sep 2020, 4:28 PM
Jayakrishna 🇮🇳