Which of the following is not an infinite loop ?
a.while(1){
....
}
b.for(;;){
...
}
c.x=0;
do{
/*x unaltered within theloop*/
...
}while(x==0);
d.# define TRUE 0
...
while(TRUE){
....
}

Answers were Sorted based on User's Feedback



Which of the following is not an infinite loop ? a.while(1){ .... } b.for(;;){ ..

Answer / deepa

d

Is This Answer Correct ?    44 Yes 2 No

Which of the following is not an infinite loop ? a.while(1){ .... } b.for(;;){ ..

Answer / krishna kumar

ya deepa is ryt.
true here equals zero...which is false.
so the correct answer is D.

Is This Answer Correct ?    23 Yes 3 No

Which of the following is not an infinite loop ? a.while(1){ .... } b.for(;;){ ..

Answer / prem

Hai Deepa,You are Absolutely right.d is the right

Is This Answer Correct ?    8 Yes 0 No

Which of the following is not an infinite loop ? a.while(1){ .... } b.for(;;){ ..

Answer / balu

yes.. deepa is right.. all are infinite loops except d. so d
is the answer

Is This Answer Correct ?    7 Yes 1 No

Which of the following is not an infinite loop ? a.while(1){ .... } b.for(;;){ ..

Answer / ramya

its d.

Is This Answer Correct ?    4 Yes 3 No

Which of the following is not an infinite loop ? a.while(1){ .... } b.for(;;){ ..

Answer / shruti

a.

while (1) is an infinite loop..

Is This Answer Correct ?    3 Yes 9 No

Which of the following is not an infinite loop ? a.while(1){ .... } b.for(;;){ ..

Answer / vaibhav

it's 'b'
becoz for for loop we initialise atleast one statement

Is This Answer Correct ?    2 Yes 13 No

Post New Answer

More C Interview Questions

what is a static function

10 Answers   Satyam,


what is the output of the program and explain why?? #include<stdio.h> void main ( ) { int k=4,j=0: switch (k) { case 3; j=300; case 4: j=400: case 5: j=500; } printf (“%d\n”,j); }

14 Answers   Oracle,


how to implement stack work as a queue?

2 Answers  


1)what is the error in the following stmt where str is a char array and the stmt is supposed to traverse through the whole character string str? for(i=0;str[i];i++) a)There is no error. b)There shud be no ; after the stmt. c)The cond shud be str[i]!='\0' d)The cond shud be str[i]!=NULL e)i shud be initialized to 1

4 Answers  


what is difference between overriding and overloading?

1 Answers  


when to use : in c program?

2 Answers  


What's the best way to declare and define global variables?

7 Answers  


Why is c not oop?

0 Answers  


What is the purpose of sprintf?

0 Answers  


main() { printf("\n %d %d %d",sizeof('3'),sizeof("3"),sizeof(3)); }

6 Answers  


what do structure language means?

3 Answers   Microsoft,


Is there something we can do in C but not in C++? Declare variable names that are keywords in C++ but not C.

2 Answers   Infosys,


Categories