Whi do i know how many times a while statement looped. | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Whi do i know how many times a while statement looped.

Is there a way to get the no of times a while statement looped?

2nd Jan 2021, 9:44 PM
Amit Kumar
Amit Kumar - avatar
2 Answers
+ 3
Keep track of the loop count with a variable. Simply increment it at the end of the loop
2nd Jan 2021, 10:47 PM
Ben Allen (Njinx)
Ben Allen (Njinx) - avatar
0
Thanks
4th Jan 2021, 4:31 PM
Amit Kumar
Amit Kumar - avatar