Welcome Guest | Sign in | Register
If statements - Discussion Page For Q.10479 | C Programming Questions and Answers | C Programming Free Online-Tests | LucentBlackBoard | LucentBlackBoard.com

Home > Java Programming > If statements > Questions and Answers

Q: What is the output of following C code?
main()
{
float me = 1.1;
double you = 1.1;
if(me==you)
printf("I love U");
else
printf("I hate U");
}
A. I hate U B. I love U
C. Compiler error D. None of these

Answer and Explanation

Answer:I hate U

Explanation:
For floating point numbers (float, double, long double) the values cannot be predicted exactly.

Comment on this Question

Name:

Loading...




Partner Sites
LucentBlackBoard.com                  SoftLucent.com                  LucentJobs.com
All rights reserved © 2012-2015 SoftLucent.