+ 2

Would n't num=2 be possible??? (in the given example)

15th Nov 2018, 4:59 AM
Anamika Yadav
Anamika Yadav - avatar
2 Antworten
+ 13
//so here is your code , I found ☺ https://code.sololearn.com/c7vUnMSVbXt5/?ref=app since the increment statement is "num = num+3;" so initially starting with num = 1 since 1 < 6 , so 1 gets printed & then num gets increased by 3 ... ie num=4 since 4 < 6 , so 4 gets printed & then num gets again increased by 3 again , ie num = 7 but 7 is not < 6 , so loops stops
15th Nov 2018, 7:14 AM
Gaurav Agrawal
Gaurav Agrawal - avatar
+ 2
Hi! It seems you forgot to share the example! And make sure to tag the language! Thanks 😊
15th Nov 2018, 5:06 AM
Kishalaya Saha
Kishalaya Saha - avatar