+ 1

What is the difference between for and while loop

can I use for instead of while

7th Apr 2018, 1:39 PM
roshan
roshan - avatar
1 Answer
+ 2
They're functionally equivalent, but there are cases where one or the other is more suitable (e.g. semantically). Pretty much anything you write with one you can do with the other
7th Apr 2018, 1:52 PM
Dan Walker
Dan Walker - avatar