for(i=1;i>0;i++);
printf("i=%d",i);
what will be the answer????
Answer Posted / vignesh1988i
since after the loop there is a semicolon , so according to
the compiler this semicolon will be taken as next line and
the loop will be iterating till the termination condition....
output possibilities :
1)if the variable 'i' which is used as an signed integer
variable , this will take an infinite values and stop at one
instance and it will terminate the application. but wont
display anything in the screen
2) if this is an unsigned variable this will be infinite
with values going on and on without stopping.. but not
displaying it...
conclusion : loop is infinite here.....
thank u
| Is This Answer Correct ? | 12 Yes | 8 No |
Post New Answer View All Answers
Should I use symbolic names like true and false for boolean constants, or plain 1 and 0?
What is the general form of #line preprocessor?
how logic is used
Write a C Program That Will Count The Number Of Even And Odd Integers In A Set using while loop
What is file in c language?
a way in which a pointer stores the address of a pointer which stores the value of the target value a) reference b) allocation c) multiple indirection d) none
What is clrscr ()?
When is a void pointer used?
How can you read a directory in a C program?
What are the advantages of Macro over function?
Function which gives a pointer to a binary trees const an integer value at each code, return function of all the nodes in binary tree.?
What is a program flowchart?
Why cant I open a file by its explicit path?
Explain what are the advantages and disadvantages of a heap?
the statement while(i) puts the entire logic in loop. this loop is called a) indefinite loop b) definite loop c) loop syntax wrong d) none of the above