Computer Science, asked by sanghsis, 6 months ago

2.How many times the loop will be executed
int x=2,y=50;
do
{
++x;
y-=x++;
}
while(x<=10);

Answers

Answered by AnindaBasu
9

Answer:

8 times the loop will execute and value of y will be 47, 46, 45,44,43,42,41,40

Answered by parveenmahek095
0

Answer:

the loop executes 4 times

x=2

do

{

++x= 3

50-3=47

now x++= 4

but it will become 5 when it comes again to ++x and hence continues with 7 and 9

loop executes 4 times 3,5,7,9

Similar questions