0

What is different betweem if loop and while loop

loop

27th Dec 2016, 7:46 PM
vikas
vikas - avatar
4 Antworten
+ 5
"if" isn't a loop, it's a conditional (like "switch")
27th Dec 2016, 7:49 PM
Valen.H. ~
Valen.H. ~ - avatar
+ 4
loops are: while, do-while, for, foreach, for...in, ...
27th Dec 2016, 7:50 PM
Valen.H. ~
Valen.H. ~ - avatar
+ 1
if is for checking condition and its not loop.
27th Dec 2016, 8:09 PM
Matin Zadehdolatabad
Matin Zadehdolatabad - avatar
0
if the condition is true the if block is executed once only. the while block keeps being repeated as long as the condition stays true, this may even be forever if the while block does not modify the result of the condition!
27th Dec 2016, 8:47 PM
ifl
ifl - avatar