C Program To Convert Fahrenheit To Celsius
C Program To Convert Fahrenheit To Celsius
Learn How To Convert Fahrenheit To Celsius in C Programming Language. This C Code For Temperature Conversion from Fahrenheit into Celsius is developed using Simple Mathematical Operators.
Formula To Convert From Fahrenheit To Celsius:
Celsius = (Fahrenheit – 32 ) / (9/5)
This Formula can be further modified as:
Celsius = (Fahrenheit – 32 ) / (1.8)
Program:
1
2
3
4
5
6
7
8
9
10
11
12
|
#include<stdio.h>
#include<conio.h>
Void main()
{
double celsius, fahrenheit;
printf("\nEnter The Temperature in Fahrenheit:");
scanf("%lf", &fahrenheit);
celsius = (fahrenheit - 32)/1.8;
printf("\nTemperature in Celsius: %lf", celsius);
printf("\n");
}
|
Expected Output:
Enter The Temperature in Fahrenheit:168
Temperature in Celsius:75.5556
Comments
Post a Comment