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 0while(TRUE){....}

D
This question is related to TCS Interview

Showing Answers 1 - 2 of 2 Answers

laxmikanth

  • Feb 10th, 2006
 

ans is d.

we have defined true as 0 in macro.so where ever True is there 0 will be substituted.while(0) is not an infinite loop where as while(1) is an infinite loop.

poornima

  • Sep 25th, 2007
 

D is the right answer.

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions