What is the truth value of a negative value entered in a while loop?
Answers
Answered by
0
Use an if condition to know the number is less than 0 or not. And if yes, just use break statement inside it, which will bring you out of the loop
Similar questions