Convert Temperature Celsius to Fahrenheit in C Language

C Program to convert celsius to Fahrenheit – Hi guys welcome to my website Crazeinfo.com, Today we are talking about converting Temperature Celsius to Fahrenheit. In this blog post, we learn how to write a C program to convert celsius to Fahrenheit. We will write the C program to convert Celsius to Fahrenheit. Write a program to input temperature in Centigrade and convert it to Fahrenheit. How to convert temperature from degree centigrade to degree Fahrenheit in C programming. Logic to convert temperature from Celsius to Fahrenheit in C.

Formula to convert Celsius to Fahrenheit:

Formula(°C × 9/5) + 32 = °F

Example:-

C program to convert Celsius to Fahrenheit:

The below program asks the user to enter the temperature in Celsius. After getting the temperature in Celsius from the user program convert it into terms Fahrenheit.

#include<stdio.h>

int main()

{

float celsius, fahrenheit;

printf(“Please Enter temaperature in celcius: “);

scanf(“%f”, &celsius);

//celsius to fahrenheit conversion formula

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

printf(“%.2f Celsius = %.2f Fahrenheit”, celsius, fahrenheit);

return0;

}

Output:

Enter temperature in Celsius: 0
0.00 Celsius = 32.00 Fahrenheit

Formula to convert Fahrenheit to Celsius:

C program to convert Fahrenheit to celsius – We will write the C program to convert Fahrenheit to celsius. Write a C program to input temperature in Fahrenheit and convert it to Centigrade. How to convert temperature from degree Fahrenheit to degree centigrade in C programming. Logic to convert temperature from Fahrenheit to Celsius in C.

Formula(°F − 32) x 5/9 = °C

C program to convert Fahrenheit to Celsius:

The below program ask the user to enter the temperature in Fahrenheit. After getting the temperature in Fahrenheit from the user program covert it into terms celsius.

#include <stdio.h>

int main()

{

float celsius, fahrenheit;

printf(“Enter temperature in Fahrenheit: “);

scanf(“%f”, &fahrenheit);

//celsius to fahrenheit conversion formula

celsius = (fahrenheit – 32) / 1.8;

printf(“%.2f Celsius = %.2f Fahrenheit”,fahrenheit,celsius);

return0;

}

Output:

Enter temperature in Fahrenheit: 32
32.00 Celsius = 0.00 Fahrenheit

About

Thanks for staying here in this article, I introduce myself I am a BCA 3rd year student, and everything you read in this article is fine and trustable because I also run these codes on my computer so don’t worry.

Leave a Comment

Your email address will not be published.

Scroll to Top