/*this program changes farenheit to celsius*/ #include /*all c programs must start with this*/ main() /*this is the main function it marks the begining of the program*/ { /*beneath this are character declarations*/ float celsius, faren; /*float allows decimal points*/ char bell='\a'; /*this allows the computers bell to ring later*/ printf("enter farenheit "); /*prompts the user to enter a number*/ scanf("%f", &faren); /*this line reads what the user entered*/ celsius=(faren-32)*(5.0/9.0); /*this is the translation formula*/ printf("Temp in celsius \n", celsius); /*this shows the results and goes to the next line*/ printf("%c", bell,'\n'); /*this rings the computers bell and goes to the next line*/ return; /*all programs must contain this at the end*/ } /*the matches the bracket at the begining and ends the program*/ /*I tried several versions of this program, they didn't seem to work, I couldn't get it to run properly with all the variables. I did get it to work just using the numbers above. I don't know what the program below doesn't work. It does ok until it has to do the calculation, then it just prints zeros accross the screen #include.h main() { float celsius, faren, a, b; these are the character declarations int i; char bell='\a'; rings the computer bell faren=0; i=32; this is the body of the program a=5.0; b=9.0; printf("enter farenheight "); scanf("%f", &faren); printf("%f", faren); celsius = (faren - i) * ( a / b ); this is the formula that transalates farenheit into celsius, but does not seem to work printf("%d %f %f %f", celsius, faren, a, b); printf("%c", bell,'\n'); return; }*/