Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
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
Advertisements