18. How many times is the following loop executed ?
int s = 0, i = 0;
while (i++ < 5)
s += i;
Answers
Answered by
4
Given:
loop executed
int s = 0, i = 0;
while (i++ < 5)
s += i;
Answer:
5 times
Explanation
i++ means increment so the value will start for 0.
value of i=0
Similar questions