Code:
#iclude < stdio.h > /*Include spelled wrong*/
#include <math.h >
main() /*main returns an int int main()*/
{
float fahr, celsius, kelvin; /*These aren't used*/
int temp, cels, kelv /*Make these floats Integers can't have decimals*/ /*Missing ;*/
temp = ' ' /*This should be a number not a character*/ /*missing ;*/
printf("Please enter (in fahr) a temp\n(q to quit)\n");
while (temp != 'q') { /*Temp is a float and will never equal q so just do while(1)*/
temp = getc ( stdin ); /*You can use scanf(" %d",&temp);*/
putchar (temp); /*I'm assuming that this is for checking and can be removed*/
cels = (temp-32.0) + (5.0/9.0); /*You do not need the .0 at the end of all numbers*/
kelv = 273.5 + ((temp - 32.0) + (5.0/9.0)); /*same thing as previous*/
printf("The temperature in Celsius is %6.1f\n" , cels);
printf("The temperature in Kelvin is %6.1f\n" , kelv);
}
return = 0 /*return 0;*/
}