I wrote a program converting fahrenheit to celsius but the requirement calls for using int for fahrenheit and float for celsius. Obviously thats leading to possible loss of data warnings. What can I do? And does anyone know why the "0" isn't showng in the celsius column? I think it was there but I changes something and now its gone?
Code:#include <stdio.h> #include <stdlib.h> int main() { int fahrenheit; float celsius; int lower, upper, step; printf( "Fahrenheit Celsius\n\n" ); lower = 0; upper = 212; step = 1; fahrenheit = lower; while (fahrenheit <= upper) { celsius = ( 5.0/9.0 ) * ( fahrenheit - 32.0 ); printf( "%10.0d %+10.3f\n", fahrenheit, celsius ); fahrenheit = fahrenheit + step; } return 0; }