It’s been a while since I posted another C program. My previous program was How toConvert km to m,feet,inch and cm in C. This is a C program to convert temperature from Fahrenheit to Centigrade. This is the 4th question of section I of the first chapter: Getting Started of the book, “Let us C” by “Yashwant Kanetkar”. I would really like if you post a thank you in the comments. If you have any doubts, requests or suggestions, feel free to use our comments section. Do share it with your friends and fellow learners as it maybe helpful for them.

## Question:

Temperature of a city in Fahrenheit degrees is input through keyboard. Write a program to convert temperature into centigrade degrees.

### Solution: C program to convert temperature

First we to accept the temperature and store it into float datatype. The formula (f – 32) / 1.8 is used to convert temperature from Fahrenheit to centigrade. The value obtained from the formula is stored in another float variable and then the result is displayed. This is a very simple program and can be done in minutes.

### Source Code: C program to convert temperature

```#include<stdio.h>
#include<conio.h>
void main()
{
float f, c;
clrscr();
printf("Enter temperature in Fahrenheit: ");
scanf("%f", &f);
c= (f - 32) / 1.8;
getch();
}```

Output:

Enter temperature in Fahrenheit: 43