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
#define MAX(x,y) (x) >(y)?(x):(y) main() { inti=10,j=5,k=0; k= MAX(i++,++j); printf("%d..%d..%d",i,j,k); }
What do you mean by command line argument?
Who developed c language and when?
How can you invoke another program from within a C program?
Do you have any idea about the use of "auto" keyword?
What does it mean when the linker says that _end is undefined?
How do you sort filenames in a directory?
what is the difference between 123 and 0123 in c?
Why is it important to memset a variable, immediately after allocating memory to it ?
What is New modifiers?
Explain the difference between call by value and call by reference in c language?
can we have joblib in a proc ?
What is wrong with this program statement?
Describe wild pointers in c?
List the different types of c tokens?