| Branko0611 (4) | |||
Why doesn't this work? ,I'm trying to write a number and then if it is lower than 3 it will display yeeaa... but instead it just displays yeaaa... | |||
|
|
|||
| Athar (4466) | |
| Your loop body will only execute when b<3. Since that's never true, it will obviously never execute. | |
|
|
|
| Branko0611 (4) | |||
I see it now... thanks, but when I change that and enter 4 it displays yeaaa but it shouldn't,why?
| |||
|
|
|||
| faieq92 (150) | |
|
because it has exited the loop as b is no longer bigger than 3 it is the same. you entered 4 4 is bigger than 3 so b--(or b-1) b Is now 3 3 is not bigger than 3 loop exits displays yea | |
|
|
|
| faieq92 (150) | |
| also what are you using int a for? | |
|
|
|