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
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
Can we increase size of array in c?
Can a pointer be static?
What is c language & why it is used?
Write the program that calculates and prints the average of several integers. Assume that the last value read is sentinel 9999.
What are c preprocessors?
What is the best way to comment out a section of code that contains comments?
Explain low-order bytes.
What is int main () in c?
If a variable is a pointer to a structure, then which operator is used to access data members of the structure through the pointer variable?
what is the basis for selection of arrays or pointers as data structure in a program
a number whose only prime factors are 2,3,5, and 7 is call humble number,,write a program to find and display the nth element in this sequence.. sample input : 2,3,4,11,12,13, and 100.. sample output : the 2nd humble number is 2,the 3rd humble number is 3,the 4th humble number is ,the 11th humble number is 12, the 12th humble number is 14, the 13th humble number is 15, the 100th humble number is 450.
Is it possible to initialize a variable at the time it was declared?
How can a program be made to print the name of a source file where an error occurs?
hai iam working in sap sd module for one year and working in lumax ind ltd in desp department but my problem is i have done m.b.a in hr/marketing and working sap sd there is any combination it. can you give right solution of my problem. and what can i do?