C - Pointers - Discussion

You Are Here :: Home > C > Pointers - Discussion

 



Q.

main()

{
float me = 1.1;
double you = 1.1;
if(me==you)
printf("I love U");
else
printf("I hate U");
}

A. I love U B. I hate U
C. love = hate D. None of the above

Answer: Option B
Explaination:

For floating point numbers (float, double, long double) the values cannot be predicted exactly. Depending on the number of bytes, the precession with of the value represented varies. Float takes 4 bytes and long double takes 10 bytes. So float stores 0.9 with less precision than long double.



Discussion

Your Comments Goes here...
NameDiscussion