mercredi 27 mai 2015

Understanding Float in C programming [duplicate]

This question already has an answer here:

Output of the C code here is "outside if condition". As x is float it should enter the if condition isn't it?

#include <stdio.h>

    main()

    {

        float x = 0.2;

        if (x==0.2)

            printf("x=0.2 \n");

        else

            printf("outside if condition");

    }

Aucun commentaire:

Enregistrer un commentaire