0
Please tell me why it is also printing 11 ?
While ( i <= 10 ) https://code.sololearn.com/co6zHb8oah6O/?ref=app
4 odpowiedzi
+ 2
Because of i<=10.
Try this instead
i < 10
+ 1
i <= 10 means i less than or equal to 10 whereas i isn't equal to 10 in i < 10
+ 1
Abhay mishra
i <= 10 means less or equal to 10
10 <= 10 //returns true
So i would be 10 it will satisfy condition and code inside if block would be execute so it will print 11
0
Yes sir when i wrote i<10 it work . But please tell me reason why i <= 10 is wrong . I mean it should not be more than 10 than why is it ?