Here is a C program to convert temperature in Fahrenheit to Centigrade with output and proper explanation. This can be easily done with the help of a simple formula.
Formula: The formula for Fahrenheit to Centigrade conversion is - C = (F - 32) / 1.8
# include <stdio.h> # include <conio.h> void main() { float c, f ; clrscr() ; printf("Enter the fahrenheit : ") ; scanf("%f", &f) ; c = (f - 32) / 1.8 ; printf("\nThe centigrade is : %.2f", c) ; getch() ; }
Note: In above program %f is used for inputting and outputting float (decimal) values while %.2f is used to print values up to precision of two digits after decimal.
Output of above program is
Enter the fahrenheit : 122
The centigrade is : 50.00
Explanation of above program
The program is very simple to understand. All we're doing is just using
the formula and applying the arithmetic operations to make the
conversion of Fahrenheit to Centigrade.
Hi There,
A really interesting, clear and easily readable
C Programming Tutorial article of interesting and different perspectives' will clap. So much is so well covered here.
I am writing a program. In a situation I want to print something and go to clear the screen but when I clear the screen the printed text also gets cleared. I want it such that after the print we have to click a key for the screen to get cleared. Is there a command or code which does that.
It was cool to see your article pop up in my google search for the process yesterday. Great Guide.
Keep up the good work!
Grazie,
Pranavi