C Puzzle #9


Clear your concepts related to floating number concept in c programming. Can you guess the output. If your answer is F is 1.0, better think again.

#include <stdio.h>

int main()
{
        float f=0.0f;
        int i;

        for(i=0;i<10;i++)
                f = f + 0.1f;

        if(f == 1.0f)
                printf("f is equal 1.0 \n");
        else
                printf("f is NOT equal to 1.0\n");

        return 0;
}

1 comment:

Your answer for the question

Related Posts Plugin for WordPress, Blogger...