Computer Science, asked by ishiii35, 1 year ago

int s=0, a=0;
while(a++greater than or equal to 5)
s+ =a;
How many times this loop executed?????
plzzz ans.fast.......
it's urgent...​


ishiii35: i want that how we can find solution how we got...???
ishiii35: our ans
shardul1925: wait i m doing it again

Answers

Answered by shardul1925
0

int s=0,a=0;

while ( (a++) >=5)

s+=a;

The loop will run 6 times as initially the values of a will be:-

1st run=0

2 run=1

3 run=2

4run=3

5run=4

6run=5

So the loop will terminate when it will come to the 5.

Similar questions