0
Where is it benificial to use while loop instead of for loop in any language?
I came across some programs where i think using while loop was more relevant. But they do the same task..can someone tell me the practical difference between the both
2 Answers
+ 1
You use a for loop, when you know how many times you want to loop your code. Whereas you use a while loop when you don't know how many times you want to run your loop..... Hope this makes sense..