C Programming :: Variables & Data Types - Discussion
Home > C Programming > Variables & Data Types > MCQs Questions Discussion
2 / 51
What will be output of the following "c" code?
#include<stdio.h>
void main()
{
float me = 1.1;
double you = 1.1;
if(me==you)
printf("I love U");
else
printf("I hate U");
}
#include<stdio.h>
void main()
{
float me = 1.1;
double you = 1.1;
if(me==you)
printf("I love U");
else
printf("I hate U");
}
AI hate U
BI love U
CCompiler Error
DNone of these
Answer: Option (Login/Signup)
Show Explanation
Asked In ::
STEP-BY-STEP
Here, the 2 objects me and you may have the same content i.e, 1.1, but their data types are different, or we can say that their references are different, and we know that == operator checks the reference whether they are same or not.
Here, it's not, so the output is I hate U.
Read Full Answer
Report Error
Please Login First Click Here