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 |
How do you use a pointer to a function?
what are the stages of compilation
Can a binary search tree be used as an index? If yes, how? Explain
How many types of errors are there in c language? Explain
Why doesn't the code "a[i] = i++;" work?
Which weighs more, a gram of feathers or a gram of gold?
What is the purpose of clrscr () printf () and getch ()?
what is diognisis?
if (i = 0)printf ("True"); elseprintf("False"); Under what conditions will the above print out the string "True" a) Never b) Always c) When the value of i is 0 d) all of the above
What is preprocessor with example?
a function gets called when the function name is followed by a a) semicolon (;) b) period(.) c) ! d) none of the above
Write a program in C to reverse a number by recursive function?