Home » C Programming » Data Types » Question
  1. What will be the output of the following C code?
    #include <stdio.h>
    int main()
    {
    float num = 0.2;
    if (num == 0.2f)
    {
    printf("Equal\n");
    }
    else
    {
    printf("Not Equal\n");
    }
    }
    1. Equal
    2. Not Equal
    3. output depends on compiler
    4. Compilation Error
    5. None of these
Correct Option: A

0.2f results in 0.2 to be stored in floating point representations.



Your comments will be displayed only after manual approval.