I am facing very very strange issue.
I am writing very simple program in C
.
Program needs to do: read real number and display it on console.
#include <stdio.h>
int main()
{
double a;
printf("Give a: ");
scanf("%f",&a);
printf("Result for a = %f \n",a);
return 0;
}
output:
sh-4.3$ gcc -o main *.c
sh-4.3$ main
Give a: 123.345
Result for a = 0.000000
Why there is 0.0000 instead of my number? Personally I have no idea.... code from this site is working fine.
Any idea?