91.5k views
9 votes
Write a program to convert centigrade to Kelvin. It should display value in centigrade and then the value in Kelvin just as you displayed squares in the previous question. The range to be followed for this conversion is from 50-100 degree celsius.

So, it should look like this:
1. Centrigrade: 50 --> Kelvin: 323.15
2. Centrigrade: 51 --> Kelvin: 324.15
3. Centrigrade: 52 --> Kelvin: 325.15
etc.

User Starkshang
by
5.8k points

1 Answer

8 votes

Answer:

for degree in range(50, 101):

kelvin = degree + 273.15

print("Centrigrade: {} --> Kelvin: {}".format(degree, kelvin))

Step-by-step explanation:

*The code is in Python.

Create a for loop that iterates from 50 to 100 (Note that the starting value is included, but the ending value is not included in the range method. That is why you need to write range(50, 101) to iterate from 50 to 100)

Convert the centigrade to kelvin using formula (Note that the degree variable represents the each centigrade degree from 50 to 100 and you need to add 273.15 to convert it to Kelvin)

Print the result as in requested format

User Arunmu
by
6.1k points