main()
{
float a=8.8;
double b=8.8;
if(a==b)
printf("Equal");
else
printf("not equal");
getch();
}
what is the output?
with reason
Answer Posted / sandy0103
I am NOT sure, if it is something to do with the compiler,
rather it is something to do with the precision. Float has
got single precision and double is double precision. This
precision difference will get different value when you see
raw value. In another sense, I tried debugging the program
in VS2005 debugger, and if we monitor the value using
watch, you can see for float it is taking the value
as "8.8000002" and for double, it is taking value as "
8.8000000000000007". And hence the precision plays a role
here.
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
How do we make a global variable accessible across files? Explain the extern keyword?
Differentiate between full, complete & perfect binary trees.
Can we declare variables anywhere in c?
How will you divide two numbers in a MACRO?
How do you view the path?
What is pointer to pointer in c language?
Tell us something about keyword 'auto'.
Are c and c++ the same?
Is void a keyword in c?
What is the difference between break and continue?
Why & is used in scanf in c?
What does a derived class inherit from a base class a) Only the Public members of the base class b) Only the Protected members of the base class c) Both the Public and the Protected members of the base class d) .c file
What are terms in math?
What is the best way to store flag values in a program?
What is the use of parallelize in spark?