Algorithm
- Input: Take the Celsius temperature as input.
- Conversion Formula: Use the following formula to convert Celsius to Fahrenheit:
-
makefile
Fahrenheit = (Celsius * 9/5) + 32;
- Calculation: Substitute the input Celsius temperature into the formula to calculate the equivalent Fahrenheit temperature.
- Output: Display or return the calculated Fahrenheit temperature.
Code Examples
#1 Code Example- Celsius to Fahrenheit
Code -
Javascript Programming
// program to convert celsius to fahrenheit
// ask the celsius value to the user
const celsius = prompt("Enter a celsius value: ");
// calculate fahrenheit
const fahrenheit = (celsius * 1.8) + 32
// display the result
console.log(`${celsius} degree celsius is equal to ${fahrenheit} degree fahrenheit.`);
Copy The Code &
Try With Live Editor
Output
Enter a celsius value: 55
55 degree celsius is equal to 131 degree fahrenheit.
55 degree celsius is equal to 131 degree fahrenheit.
Demonstration
Javascript Programing Example to Convert Celsius to Fahrenheit-DevsEnv