what is the output of the following program?
#include<stdio.h>
void main()
{
float x=1.1;
while(x==1.1)
{
printf("\n%f",x);
x=x-0.1;
}
}
Answer Posted / battini.laxman
No output.Loop will not execute atleast once. because
compiler will treat real constant as double. So real
constants will not store exactly equal to that constant
value but appproximately equal to that constan in binary
format. So float value and doule value storing
approximately equal but not exactly.small difference will
be there.so condition will fail at first time.So loop will
not execute atleast once.
| Is This Answer Correct ? | 17 Yes | 0 No |
Post New Answer View All Answers
void main(){ int a; a=1; while(a-->=1) while(a-->=0); printf("%d",a); }
Define macros.
Describe the steps to insert data into a singly linked list.
.main() { char *p = "hello world!"; p[0] = 'H'; printf("%s",p); }
What is an expression?
What does *p++ do? What does it point to?
Synonymous with pointer array a) character array b) ragged array c) multiple array d) none
What are the disadvantages of external storage class?
Why is c called "mother" language?
What are the application of void data type in c?
Can you write the function prototype, definition and mention the other requirements.
code for replace tabs with equivalent number of blanks
Explain the difference between #include "..." And #include <...> In c?
Do you know the purpose of 'register' keyword?
What is #include called?