LogiQuest
Back to Floating Point Issues
11

What will be the output of the program?

#include <stdio.h>
#include <math.h>

int main(void) {
    double x = 0.1 + 0.2;
    printf("%d\n", fabs(x - 0.3) < 1e-9);
    return 0;
}
Medium

Discussion (0)

  • No discussion yet. Ask a doubt or share a shortcut.

Log in to join the discussion.