0% found this document useful (0 votes)
50 views

Program To Convert Celsius To Kelvin

This document contains code for 4 programs that convert between Celsius, Kelvin, and Fahrenheit temperature scales. Each program uses the C++ language to declare and initialize variables, take user input for a temperature value, perform the conversion calculation, and output the converted temperature. The programs demonstrate the mathematical relationships between the different temperature scales.

Uploaded by

M Noaman Akbar
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
50 views

Program To Convert Celsius To Kelvin

This document contains code for 4 programs that convert between Celsius, Kelvin, and Fahrenheit temperature scales. Each program uses the C++ language to declare and initialize variables, take user input for a temperature value, perform the conversion calculation, and output the converted temperature. The programs demonstrate the mathematical relationships between the different temperature scales.

Uploaded by

M Noaman Akbar
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 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