Q:

Program to convert Celsius into Fahrenheit

belongs to collection: Basic Programs

0

Explanation

Fahrenheit and Celsius are the measures of temperature having Unit in degrees as oF

oC respectively. In this tutorial, we have to convert Celsius to Fahrenheit by using the scientific formula in programmes of different languages.

Formula

T(oF)   =  (T(oC)   ×  (9/5)) + 32

Algorithm

  1. Define temperature in Celsius unit.
  2. Apply in the formula.
  3. Print the temperature in Fahrenheit.

Complexity

O(1)

Temperature in Fahrenheit = ((celsius * 9) / 5) + 32

Input:

celsius12  

Output:

Temperature in Fahrenheit = 53.6

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

Python

celsius= 12  
fahrenheit= ((celsius*9)/5)+32  
print("Temperature in Fahrenheit is: ");  
print(fahrenheit);   

 

Output:

Temperature in Fahrenheit is: 53.6

 

C

#include<stdio.h>  
                   int main()   
                   {   
                   float fahrenheit, celsius;  
                   celsius = 24;  
                   fahrenheit =( (celsius*9)/5)+32;  
                   printf("\n\n Temperature in fahrenheit is:  %f",fahrenheit);  
                       return (0);  
    }  

 

Output:

Temperature in fahrenheit is: 75.1999997

 

JAVA

public class temperature  
 {  
   public static void main (String args[])  
    { float Fahrenheit, Celsius;  
          Celsius= 13;  
          Fahrenheit =((Celsius*9)/5)+32;  
          System.out.println("Temperature in Fahrenheit is: "+Fahrenheit);  
    }}  

 

Output:

Temperature in Fahrenheit is: 55.4

 

C#

using System;  
class main  
{   static void Main()   
    {  
         float fahrenheit, celsius;  
          celsius= 13;  
          fahrenheit =((celsius*9)/5)+32;  
       Console.WriteLine("Temperature in Fahrenheit is: "+fahrenheit);  
    }}  

 

Output:

Temperature in Fahrenheit is: 55.4

 

PHP

<?php  
       $celsius = 17 ;  
       $fahrenheit = (($celsius*9)/5)+32 ;   
       echo("Temperature in Fahrenheit is:  ");  
       echo($fahrenheit);  
?> 

 

Output:

Temperature in Fahrenheit is:  62.6

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Program to convert days into years... >>
<< Program to calculate the CGPA percentage...