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
Is null always defined as 0(zero)?
WHICH TYPE OF JOBS WE GET BY WRITING GROUPS .WHEN THE EXAMS CONDUCTED IS THIS EXAMS ARE CONDUCTED EVERY YEAR OR NOT.PLS TELL ME THE ANSWER
What are dangling pointers? How are dangling pointers different from memory leaks?
Process by which one bit pattern in to another by bit wise operation is?
Explain what will be the outcome of the following conditional statement if the value of variable s is 10?
Is it possible to use curly brackets ({}) to enclose single line code in c program?
How will you delete a node in DLL?
How do you list files in a directory?
What are multidimensional arrays?
Write a function stroverlap that takes (at least) two strings, and concatenates them, but does not duplicate any overlap. You only need to worry about overlaps between the end of the first string and the beginning of the second string. Examples: batman, manonthemoon = batmanonthemoon batmmamaman, mamamanonthemoon = batmmamamanonthemoon bat, man = batman batman, batman = batman batman, menonthemoon = batmanmenonthemoon
What are different types of pointers?
What is the data segment that is followed by c?
What do you mean by recursion in c?
if p is a string contained in a string?
What is the use of getchar functions?