in Others edited by
522 views
0 votes
0 votes

The following loop in $’C’$:

int i=0;
while (i++<0)i--;
  1. will terminate
  2. will go into an infinite loop
  3. will give compilation error
  4. will never be executed
in Others edited by
522 views

1 comment

Loop will never be executed as the very first condition of the loop is not getting satisfied, so there is no way for this loop to be executed.
0
0

2 Answers

2 votes
2 votes
In while loop, first i value will compare with 0, then it will get incremented.
So 0 < 0, is certainly false, therefore we never enter while loop,and programme terminate successfully.
option A is correct here.

3 Comments

yes option a is correct here
0
0
a is ryt
0
0
how many times loop get executed 0 or 1 times condition is false so 9 times right ?
0
0
0 votes
0 votes
initially i value is equal to 0

Now

While (i++<0)

while(0<0) this will be  false.then it will get incremented and i value become  1

So therefore we never enter in while loop so option B is incorrect

and  program terminate successfully means no compiler error so option C,option D are wrong

option A is correct here.

Related questions