GeekInterview.com
  I am new, Sign me up!
 
GeekInterview.com  >  Placement Papers  >  TCS  >  C
Go To First  |  Previous Question  |  Next Question 
 C  |  Question 45 of 87    Print  
Which of the following is not an infinite loop?

A. while(1){ ....}
B. for(;;){...}
C. x=0;
       do{ /*x unaltered within the loop*/
       .....}while(x = = 0);
D. # define TRUE 0
     ...
     while(TRUE){ ....}


  
Total Answers and Comments: 4 Last Update: June 13, 2008   
  
 Sponsored Links

 
 Best Rated Answer

No best answer available. Please pick the good answer available or submit your answer.
March 21, 2006 00:18:30   #1  
chhavi        

RE: Which of the following is not an infinite loop?

ans is c coz value of x is unaltered in loop so it will always be 0


 
Is this answer useful? Yes | No
August 29, 2006 00:47:07   #2  
abcd        

RE: Which of the following is not an infinite loop?
D
 
Is this answer useful? Yes | No
January 14, 2007 10:26:11   #3  
K.Rana Pratap        

RE: Which of the following is not an infinite loop?
It is not c) becoz in while loop comparision takes place that is 0 0(which is true and returns the value 1) so while loop executes and it goes in infinite loop. The correct answer is (D) becoz in while loop condition becomes false with zero(0) and never enters into the loop.
 
Is this answer useful? Yes | No
June 13, 2008 11:56:24   #4  
chandradeepika Member Since: May 2008   Contribution: 36    

RE: Which of the following is not an infinite loop?A. while(1){ ....}B. for(;;){...}C. x=0;       do{ /*x unaltered within the loop*/       .....}while(x = = 0);D. # define TRUE 0  &nbs
ans:D
 
Is this answer useful? Yes | No


 
Go To Top


 Sponsored Links

 
About Us -  Privacy Policy -  Terms and Conditions -  Contact -  Ask Question -  Propose Category -  Site Updates 

Copyright © 2005 - 2009 GeekInterview.com. All Rights Reserved

Page copy protected against web site content infringement by Copyscape