The Gateway to Computer Science Excellence
First time here? Checkout the FAQ!
x
+1 vote
74 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 Boss (6.2k points) | 74 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 Boss (6.6k points)
yes option a is correct here
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

29,157 questions
36,984 answers
92,154 comments
34,823 users