returning a float type from function in c

I have this simple code:

int main()
{
    float x = foo();
    printf("returned value: %f", x);
    return 0;
}

float foo ()
{
    return 5;
}

when i run the code , the output is: "returned value: -858993472.000000"

can somebody please explaing to me why does the returned value isnt 5.000000?

5
задан mskfisher 19 June 2012 в 13:24
поделиться