Program To Convert Celsius To Kelvin

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 2

Program to convert Celsius to Kelvin

#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
float a,b;
cout"Enter the Temperature in Celsius"endl;
cin>>a;
b=a+273;
cout"Temperature in Kelvin is "b;
getch();
}

Program to convert Kelvin to Celsius


#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
float a,b;
cout"Enter the Temperature in Kelvin"endl;
cin>>a;
b=a-273;
cout"Temperature in Celcius is "b;
getch();
}

Program to convert Celsius to Fahrenheit


#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
float a,b;
cout"Enter the Temperature in Celsius"endl;
cin>>a;
b=1.8*a+32.0;
cout"Temperature in Fahrenheit is "b;
getch();
}

Program to convert Fahrenheit to Celsius


#include<iostream.h>
#include<conio.h>

void main()
{
clrscr();
float a,b;
cout"Enter the Temperature in Fahrenheit"endl;
cin>>a;
b=(a-32.0)/1.8;
cout"Temperature in Celsius is "b;
getch();
}

You might also like