C-Sharp | Java | Python | Swift | GO | WPF | Ruby | Scala | F# | JavaScript | SQL | PHP | Angular | HTML
Program to convert Celsius into FahrenheitExplanationFahrenheit 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. FormulaT(oF) = (T(oC) × (9/5)) + 32 Algorithm
ComplexityO(1) SolutionPythoncelsius= 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 JAVApublic 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
Next Topic#
|