+ 2

Looping

There are 2 kinds of loop in almost every programming language but what is the need? I haven't seen a single program which I could do with for loop but not with while loop or vice versa so what is the need to have 2? Also which one of them is faster?

19th Aug 2017, 4:03 AM
Sahaj Bamba
Sahaj Bamba - avatar
4 Respuestas
19th Aug 2017, 4:21 AM
Hatsy Rei
Hatsy Rei - avatar
0
for loop is more convenient bcoz it is simpler, easier and is also the quickest loop.
19th Aug 2017, 1:58 PM
Shubhi Badole
Shubhi Badole - avatar
0
for loop is just a syntactic sugar over while loop
19th Aug 2017, 5:51 PM
Sobanya
Sobanya - avatar