+ 4
In calculator why while loop is used??
5 Answers
+ 4
To keep the program running until a code to break is executed
(you may want to try this on your computer)
+ 2
u calculate the many values repeatly that time u don't know how many times to calculate the value so that's only using while loop
u know I calculate using 5 values only using for loop
but u don't know u using while loop only
+ 1
Please insert the code you are refering to.
+ 1
You can also it if u want to do calculation until a number is given as input
for example: Let's say that u want can do 10 operations in the calculator and u want to do as many calculation as u want if you need to end it enter such that if a number is entered the loop which makes the condition false and ends the program .
I hope it is understandable đ
đ
+ 1
the calculator keeps on waiting for input from the user, until we turn it off (here some break condition to exit from the loop). To keep it in waiting mode, we use while loop.