# Program for Fahrenheit to Celsius conversion

Given a Temperature n in Fahrenheit scale convert it into Celsius scale .

Examples:

```Input : 32
Output : 0

Input :- 40
Output : -40
```

## Recommended: Please try your approach on {IDE} first, before moving on to the solution.

Formula for converting Fahrenheit scale to Celsius scale

`T(°C) = (T(°F) - 32) × 5/9`

## C++

 `// CPP program to convert Fahrenheit ` `// scale  to Celsius scale ` `#include ` `using` `namespace` `std; ` ` `  `// function to convert  ` `// Fahrenheit to Celsius ` `float` `Conversion(``float` `n) ` `{ ` `    ``return` `(n - 32.0) * 5.0 / 9.0; ` `} ` ` `  `// driver code ` `int` `main() ` `{ ` `    ``float` `n = 40; ` `    ``cout << Conversion(n); ` `    ``return` `0; ` `} `

## Java

 `// Java program to convert Fahrenheit ` `// scale to Celsius scale ` `class` `GFG { ` `     `  `// function to convert ` `// Fahrenheit to Celsius ` `static` `float` `Conversion(``float` `n) ` `{  ` `    ``return` `(n - ``32``.0f) * ``5``.0f / ``9``.0f; ` `} ` ` `  `// Driver code ` `public` `static` `void` `main(String[] args) { ` `    ``float` `n = ``40``; ` `    ``System.out.println(Conversion(n)); ` `} ` `} ` ` `  `// This code is contributed by Anant Agarwal. `

## Python3

 `# Python3 program to convert Fahrenheit ` `# scale to Celsius scale ` ` `  `# function to convert  ` `# Fahrenheit to Celsius ` `def` `Conversion(n): ` `    ``return``(n ``-` `32.0``) ``*` `5.0` `/` `9.0` ` `  `# driver code ` `n ``=` `40` `x ``=` `Conversion(n) ` `print` `(x) ` ` `  `# This article is contributed by Himanshu Ranjan `

## C#

 `// c# program to convert Fahrenheit ` `// scale to Celsius scale ` `using` `System; ` ` `  `class` `GFG { ` `     `  `// function to convert ` `// Fahrenheit to Celsius ` `static` `float` `Conversion(``float` `n) ` `{  ` `    ``return` `(n - 32.0f) * 5.0f / 9.0f; ` `} ` ` `  `// Driver code ` `public` `static` `void` `Main() ` `{ ` `    ``float` `n = 40; ` `    ``Console.Write(Conversion(n)); ` `} ` `} ` ` `  `// This code is contributed by Nitin Mittal. `

## PHP

 ` `

Output:

```4.44444
```

This article is contributed by Dibyendu Roy Chaudhuri. If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

My Personal Notes arrow_drop_up

Improved By : nitin mittal

Article Tags :

Be the First to upvote.

Please write to us at contribute@geeksforgeeks.org to report any issue with the above content.