Predict the output of following code:
main()
{
float a=1.1;
double b=1.1;
if(a==b) // datatype is different cant be compared; hence result will be 0
printf(“equal”);
else
printf(“not equal”);
}
1. equal
2. not equal
3. Error
4. equal not equal; Predict the output of following code:; main(); {; float a=1.1;; double b=1.1;; if(a==b) // datatype is different cant be compared; hence result will be 0; printf(“equal”);; else; printf(“not equal”);; }; 1. equal; 2. not equal; 3. Error; 4. equal not equal
Answers
Answered by
0
Hey Mate!
Your answer is 3. Error
As when if statement will be executed it cannot be compared .So, it will show you an error.
Your answer is 3. Error
As when if statement will be executed it cannot be compared .So, it will show you an error.
Similar questions