Welcome Guest | Sign in | Register
Loops - Discussion Page For Q.10439 | C Programming Questions and Answers | C Programming Free Online-Tests | LucentBlackBoard | LucentBlackBoard.com

Home > Java Programming > Loops > Questions and Answers

Q: How many times the below loop will run
main()
{
int i;
i=0;
do
{
--i;
printf("%d",i);
i++;
}
while(i>=0);
}
A. 1 B. Infinite
C. 0 D. Compilation Error

Answer and Explanation

Answer:Infinite

Explanation:
In every iteration value of i is decremented and then incremented so remains 0 and hence a Infinite Loop

Comment on this Question

Name:

Loading...




Partner Sites
LucentBlackBoard.com                  SoftLucent.com                  LucentJobs.com
All rights reserved © 2012-2015 SoftLucent.