In this tutorial, we will learn the writing program in c to convert a given temperature from Fahrenheit to celsius. This program will be simple because we have a mathematical conversion formula to convert Fahrenheit to Celsius. We will use this conversion formula in the programming logic.
How our Fahrenheit to Celsius conversion program will behave?
Our program will take a number as an input which we are considering the temperature in Fahrenheit.
Now we will use Fahrenheit to Celsius conversion formula which is
((fahrenheit-32)*5)/9.
After this calculation result will be a temperature of Celsius.
C Program to convert Fahrenheit to Celsius
#include<stdio.h>
int main()
{
float celsius, fahrenheit;
printf("Program to convert Temperature from Fahrenheit to Celsius\n");
printf("Enter temperature in Fahrenheit: ");
scanf("%f", &fahrenheit);
celsius = ((fahrenheit-32)*5)/9;
printf("%.2f fahrenheit = %.2f celsius", fahrenheit, celsius);
return (0);
}
Output
Program to convert Temperature from Fahrenheit to Celsius
Enter temperature in Fahrenheit: 98
98.00 fahrenheit = 36.67 celsius
Also Prepare Below Important Question
- Python Program to add two number using Recursion
- Python Program to Find Highest Frequency Element in Array
- Python Program to Merge two Arrays
- Perform left rotation by two positions in Array Using Python
- Python Program to Delete Element at Given Index in Array
- Python Program to Delete element at End of Array
- Python Program to Copy one String to Another String
- Python Program to Remove Repeated Character from String
- Print highest frequency Character in String in Python
- Python Program to Convert lowercase vowel to uppercase
- Convert Celsius to Fahrenheit in Python
- Leap Year Program in Python
- Python Program to convert Decimal to Octal number
- Python Program to Convert Decimal Number into Binary
- Find all Pairs Whose Sum is Equal to Given number in Python
- Python Program to Replace First Vowel With ‘-‘ in String
- Python Program to find Prime factors of given integer
- Python Program to Print Prime Number in given range
- Java Program to Perform Left Rotation on Array Elements by Two
- Java Program to Perform Right Rotation on Array Elements by Two
Interview Questions Categories
C Programming Interview Preparation
Core Java Programming Interview Preparation
- Core Java Programming Coding Questions
- Core Java Pattern Programming Questions
- Core Java Programming Interview Questions