Home » C Programming » Decision Making » Question
  1. Which of the following is the correct output for the program given below?
    #include <stdio.h>
    int main ( )
    {
    int a = 5;
    float b = 5.0;
    if (a == b)
    printf (" a and b are equal\n");
    else
    printf ("a and b are not equal\n");
    return 0;
    }
    1. a and b are equal
    2. a and b are not equal
    3. Unpredictable
    4. No output
Correct Option: A

During comparison a would get promoted to a float and then two floats would be compared.



Your comments will be displayed only after manual approval.