Redirected
edited by
513 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
edited by

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.
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

1 votes
1 votes
1 answer
1
go_editor asked Mar 28, 2020
467 views
The following determiniotic finite automata recognizes:Set of all strings containing $’ab’$Set of all strings containing $’aab’$Set of all strings ending in $’a...
0 votes
0 votes
0 answers
2
go_editor asked Mar 28, 2020
686 views
Depth ion travels of the following directed graph is:$\text{A B C D E F}$$\text{A B D E F C}$$\text{A C E B D F}$None of the above
0 votes
0 votes
0 answers
3
go_editor asked Mar 28, 2020
1,117 views
The maximum number of nodes in a binary tree of depth $10$:$1024$ $2^{10}-1$ $1000$None of the above
1 votes
1 votes
1 answer
4
go_editor asked Mar 28, 2020
1,224 views
The regular expression given below describes:$r=(1+01)$*$(0+\lambda)$Set of all string not containing $’11’$Set of all string not containing $’00’$Set of all stri...