explain while loop with example
Answers
Answered by
7
Answer:
A "While" Loop is used to repeat a specific block of code an unknown number of times, until a condition is met.
Explanation:
For example, if we want to ask a user for a number between 1 and 10, we don't know how many times the user may enter a larger number, so we keep asking "while the number is not between 1 and 10".
Answered by
0
Answer:
Here is the answer
In most computer programming languages, a while loop is a control flow statement that allows code to be executed repeatedly based on a given Boolean condition. The while loop can be thought of as a repeating if statement.
Similar questions