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 / hema

If i want to compare the value stored in float and double,
how do i do that? I tried typecasting i,e.,

if (a==float(b))
printf("Equal");
else
printf("not equal");

Even then it say, not equal. How to overcome this problem?

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

If I have a char * variable pointing to the name of a function ..

670


Explain the difference between #include "..." And #include <...> In c?

640


write a program that reads lines(using getline), converts each line to an integer using atoi, and computes the average of all the numbers read. also compute the standard deviation.

1995


What is a built-in function in C?

815


Explain what math functions are available for integers? For floating point?

624






What is the collection of communication lines and routers called?

626


Why is #define used?

804


What is multidimensional arrays

647


How can I copy just a portion of a string?

835


What is the -> in c?

596


When should a type cast be used?

586


why we wont use '&' sing in aceesing the string using scanf

1795


What is the difference between exit() and _exit() function in c?

596


How can I do serial ("comm") port I/O?

705


Is c is a high level language?

630