Showing posts with label temperature conversion. Show all posts
Showing posts with label temperature conversion. Show all posts

Monday, 15 July 2013

Temperature Conversion

Convert Fahrenheit to Celsius

C = 5/9(F - 32)

Convert Celsius to Fahrenheit


F = 9/5(C + 32)


Convert Celsius to Kelvin


K = C + 273.15

Convert Kelvin to Celsius

C = K - 273.15

If you are interested in C++ programming, please visit the following links.

Kelvin to Celsius Conversion

// 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();
}


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();
}

Sunday, 14 July 2013

Farenheit to Celsius conversion

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

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

    cout<<"Enter the value of temp in Farenheit : ";
    cin>>f;
    c = (f-32)/1.8;
    cout<<"\n\n Temp in Celsius = "<<c;
    getch();
}

Celsius to Farenheit Conversion

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

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

    cout<<"Enter the value of temp in Celsius : ";
    cin>>c;
    f=(9/5)*c+32;
    cout<<"\n\n Temp in Farenheit = "<<f;
    getch();
}