// Write a C++ program to convert temperature from
// Kelvin to Celsius.
#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
float k,c;
cout<<"\n------------------------------------\n";
cout<<" Kelvin to Celsius Conversion \n";
cout<<"------------------------------------\n\n";
cout<<"Enter the value of temp in Kelvin : ";
cin>>k;
c = k - 273.15 ;
cout<<"\n\n Temp in Kelvin = "<<c;
getch();
}
// Kelvin to Celsius.
#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
float k,c;
cout<<"\n------------------------------------\n";
cout<<" Kelvin to Celsius Conversion \n";
cout<<"------------------------------------\n\n";
cout<<"Enter the value of temp in Kelvin : ";
cin>>k;
c = k - 273.15 ;
cout<<"\n\n Temp in Kelvin = "<<c;
getch();
}
No comments:
Post a Comment