The Gateway to Computer Science Excellence
First time here? Checkout the FAQ!
x
+1 vote
180 views
The following loop in ‘C’:
int i=0;
While(i++<0)i--;
(A) will terminate
(B) will go into an infinite loop
(C) will give compilation error
(D) will never be executed



 

asked in Programming by Loyal (7.1k points) | 180 views

1 Answer

+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.
answered by Loyal (7.4k points)
0
yes option a is correct here
0
a is ryt


Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true

36,201 questions
43,661 answers
124,111 comments
42,944 users