- Home
- Course
- Arithmetic operators
- Celsius to Kelvin and Fahrenheit

Monday, November 13, 2023
⁃
Difficulty:
Easy

The Celsius scale is centigrade, 100 divisions separate the freezing point from the boiling point of water. On the Fahrenheit scale of Anglo-Saxons, these two points are 180 degrees apart. The Kelvin scale is an absolute scale used in science.

Create a Java program to convert from degrees Celsius to Kelvin and Fahrenheit. Request the user the number of degrees celsius to convert them using the following conversion tables:

- kelvin = celsius + 273
- fahrenheit = celsius x 18 / 10 + 32

- Ask the user for the amount of Celsius degrees to convert.
- Calculate the temperature in kelvin using the formula (celsius + 273).
- Calculate the temperature in fahrenheit using the formula (celsius x 18 / 10 + 32).
- Display the results of the conversion in kelvin and fahrenheit.

33

kelvin= 306 fahrenheit= 91

Share it on your social media and challenge your friends to solve programming problems. Together, we can learn and grow.

The code has been successfully copied to the clipboard.

Continue improving your Java programming skills with our selection of practical exercises from the lesson. Click on Practice and challenge your knowledge!

Practice with easy and intermediate Java exercises on arithmetic operations and some types of numerical data.