Oh no...not only does it return 1.000000 for the %f in my printf, but if I input 357, it returns the statement for water and not mecury. What am I doing wrong?
Oh no...not only does it return 1.000000 for the %f in my printf, but if I input 357, it returns the statement for water and not mecury. What am I doing wrong?
For a start, scanf (but not printf) requires %lf for a double argument.
Secondly, your within_x_percent function is declared to return an int, but you have no return statement. Why?