Convert Fahrenheit to Celsius using C Program


The logic that we implement to convert Fahrenheit to Celsius is as follows −

celsius = (fahrenheit - 32)*5/9;

Algorithm

Refer to the algorithm given below to convert Fahrenheit to Celsius.

Step 1: Declare two variables farh, cels
Step 2: Enter Fahrenheit value at run time
Step 3: Apply formula to convert
        Cels=(farh-32)*5/9;
Step 4: Print cels

Example

Following is the C program to convert Fahrenheit to Celsius −

#include<stdio.h>
int main(){
   float fahrenheit, celsius;
   //get the limit of fibonacci series
   printf("Enter Fahrenheit: 
");    scanf("%f",&fahrenheit);    celsius = (fahrenheit - 32)*5/9;    printf("Celsius: %f
", celsius);    return 0; }

Output

When the above program is executed, it produces the following result −

Enter Fahrenheit:

100
Celsius: 37.777779

Updated on: 04-Nov-2023

29K+ Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements