C Program to Convert Fahrenheit to Celsius

Here's the C Program to convert temperature from Fahrenheit to Celsius (degree centigrade).

C Program to Convert Fahrenheit to CelsiusHow this Program Work?

First, We will take the value from the user in Fahrenheit and convert it into Celsius.

Then, we'll apply the formula to convert Fahrenheit into Celsius.

Then, we'll print the value in Celsius.

C Program to Convert Fahrenheit Into Celsius

#include<stdio.h>

void main()
{

//declaration of variable
float f, c;

/*
f variable is used for farenheit
c variable is used to store value in Celsius
*/

// getting the value from user in farenheit
printf("Enter the temperature in Farenheit");
scanf("%f",&f);

// formula to convert farenheit into celsius
c = ( ( (f-32) * 5 ) / 9);

// printing the value in celsius
printf("The temperature in Celsius is %.1f Celsius",c);
}

You May Also Like:




Comments

Popular posts from this blog

Pseudocode to Check, Number is Odd or Even

How to Create Marksheet in C