0
What are a while loops and how do they function
4 Answers
+ 1
While the loop, is already defined functions in programming. It works until that the wanted givens are not acceptable.
Happy coding!
+ 1
While loops can be used when we don't know how many iterations required. Which is dependent on some conditions or parameters which will be modified inside the block of code.
#Java snippet..
int i = 0;
while(I < 5){
.........
i = i + 2;
}
0
What are iteration
0
Iterations are repetition of a process. If u know how many times iterations then use 'FOR' loop.
#while loops ex:
Sum of numbers from 0 to N. which is the max number when sum is equal or crossing 100. Find N. In this case start iteration from 1, 2,3....