0
Didn't get the difference between while (num++<5) and while (++num <5)?
8 Answers
+ 8
umm...Where does this come from? I can't really help you without knowing the origin, and the true question you have about this code.
+ 8
Right, but I mean in the courses of the app? Your own code? Someone else's code? I can tell you the difference but I have no idea what kind of effect it has on the code it comes from (be it the course examples, your code or someone else's code).
+ 8
@Rrestoring faith, you beat me to it XD
+ 6
++x increments before using x. So if x was 4 prior to the loop:
(1+4<5)
the loop will terminate.
x++ increments after using x. So if x was 4 prior to the loop:
(4<5)
the loop will continue, however after the comparison x becomes 5.
+ 1
int x=1
while (x++<5)
conslole.writeline (x);
what if i write
int x=1
while (++x <5)
console.writeline (x);
0
This comes from while loop
0
miguel silva