-3

Can you please tell me why in below code answer is 1610612736? How to calculate this answer?

    #include <stdio.h>
    int main()
    {
       float h=4.1;
       printf("\n%d\n",h);
       return 0;
    }
show team
  • 1
  • 1

1 Answers1

3

Do this instead:

printf("\n %f", h);

You need to use the right specifier... you were using %d which is for integers.

Kevin
  • 6,993
  • 1
  • 15
  • 24
Bilal Saleem
  • 633
  • 4
  • 8