C Programming :: Declarations and Initializations - Discussion
Home > C Programming > Declarations and Initializations > MCQs Questions Discussion
49 / 54
Predict the output of following code:
#include <stdio.h>
void main()
{
float a=1.1;
double b=1.1;
if(a==b)
printf("equal");
else
printf("not equal");
}
#include <stdio.h>
void main()
{
float a=1.1;
double b=1.1;
if(a==b)
printf("equal");
else
printf("not equal");
}
A? equal
Bnot equal
CError
Dequal not equal
Answer: Option (Login/Signup)
Show Explanation
Asked In ::
STEP-BY-STEP
Here, a and b may have the same content or values, but one is float while the other is double, due to which the output is not equal.
If both a and b would have been float or both double, then the output would have been equal.
Read Full Answer
Report Error
Please Login First Click Here