Monday, 15 July 2013

Celsius to Kelvin Conversion

// Write a C++ program to convert temperature from
// Celsius to Kelvin.

#include<iostream.h>
#include<conio.h>
void main()
{
    clrscr();
    float c,k;

    cout<<"\n------------------------------------\n";
    cout<<"  Celsius to Kelvin Conversion \n";
    cout<<"------------------------------------\n\n";

    cout<<"Enter the value of temp in Celsius : ";
    cin>>c;
    k = c + 273.15 ;
    cout<<"\n\n Temp in Kelvin = "<<k;
    getch();
}

No comments:

Post a Comment