+ 2
How can be it is 17?
it should run one more time till it is less than 5 I mean for the 1st instance: i=0 0<5 i++ (ie i=1) it will by pass the i==3 condition and result=0+1 = 1 for the 2nd instance I=1 1<5 I++(ie i=2) it will by pass the i==3 condition and result=1+2 = 3 for the 3rd instance i=2 2<5 i++(ie i=3) it fullfils the condition i==3 so result will be 10+3 =13 for the 4th instance i=3 3<5 i++(ie i=4) it by will bypass the i==3 condition and result=13+4=17 Now i=4 4<5 so it should run one more time why does it stops ?
3 Answers
+ 2
i = {0,1,2,3,4} and 0 to 4 except 3 calculate in else and the result is 0, 1, 2, 4 and for 3 it equal to 0 + 10 so the answer is 17 (0+1+2+4+10).
+ 1
What is the code that you are talking about?
0
jjb



