You are on page 1of 1

600mn+ Devices Protected

McAfee Total Protection - 2023 Antivirus, Security


Software for 3 Devices
₹1,199 Shop now

 

C program to convert
temperature from
degree fahrenheit to
celsius
2 mins August 17,
C programming
read 2017

Write a C program to input temperature in


degree Fahrenheit and convert it to
degree Centigrade. How to convert
temperature from Fahrenheit to Celsius in
C programming. C program for
temperature conversion. Logic to convert
temperature from Fahrenheit to Celsius in
C program.

Example
Input

Temperature in fahrenheit = 205

Output

Temperature in celsius = 96.11 C

Required knowledge
Arithmetic operators, Variables and
expressions, Data types, Data types

Temperature conversion
formula
Formula to convert temperature from
degree Fahrenheit to degree Celsius is
given by –

Logic to convert
temperature from
Fahrenheit to Celsius
Step by step descriptive logic to convert
temperature from degree Fahrenheit to
degree Celsius –

1. Input temperature in fahrenheit


from user. Store it in some variable
say fahrenheit.
2. Apply the temperature conversion
formula celsius = (fahrenheit -
32) * 5 / 9 .

3. Print the value of celsius.

Read more – Program to convert


temperature from Celsius to
Fahrenheit

Program to convert
temperature from
fahrenheit to celsius

21 Naughtiest
Wedding Pictures
ReadBakery

Copy
/**
* C program to convert temperature from de
*/

#include <stdio.h>

int main()
{
float celsius, fahrenheit;

/* Input temperature in fahrenheit */


printf("Enter temperature in Fahrenheit
scanf("%f", &fahrenheit);

/* Fahrenheit to celsius conversion for


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

/* Print the value of celsius */


printf("%.2f Fahrenheit = %.2f Celsius"

return 0;
}

%.2f is used to print fractional values


only up to two decimal places. You can
also use %f to print fractional values
normally up to six decimal places.

Trending
Classification of programming
languages

Enter temperature in Fahrenheit: 205


205.00 Fahrenheit = 96.11 Celsius

Happy coding

C program to print fibonacci series upto



n terms

C program to convert days to years



weeks and days

CONTENTS
| Required knowledge
| Temperature conversion formula
| Logic to convert temperature from
Fahrenheit to Celsius
| Program to convert temperature from
fahrenheit to celsius

CODEFORWIN

Feedback

Testimonials

Privacy policy
Terms of use

Sitemap

C PROGRAMMING

Learn C programming

C Exercises

DATA STRUCTURES

LinkedList
Stack

Queue


© 2023 Codeforwin • Built with in India.

You might also like