Can we add if else statement in while loop? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Can we add if else statement in while loop?

If no then why?. Or if yes then how?

16th Jan 2019, 1:07 PM
venkatrao bhnala
venkatrao bhnala - avatar
3 Answers
+ 2
Of course, the if statement will repeat while a condition is true. Also, make sure it has an end, otherwise, the loop will not end.
16th Jan 2019, 1:32 PM
Luis Méndez
Luis Méndez - avatar
0
Thanks for the answer it helped me a lot
16th Jan 2019, 1:26 PM
venkatrao bhnala
venkatrao bhnala - avatar
0
Thanks pav
17th Jan 2019, 10:27 AM
venkatrao bhnala
venkatrao bhnala - avatar