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
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 |
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 |
Answer / vaibhav
it's 'b'
becoz for for loop we initialise atleast one statement
| Is This Answer Correct ? | 2 Yes | 13 No |
What is 1d array in c?
how should functions be apportioned among source files?
What is Generic pointer? What is the purpose of Generic pointer? Where it is used?
What does main () mean in c?
write a program to interchange the value between two variable without using loop
Are there namespaces in c?
What is a char c?
What is meant by realloc()?
what is the self-referential structure?
how to write hello word without using semicolon at the end?
What is union and structure?
What is cohesion and coupling in c?