Monday, 22 April 2013

Conversion of Fahrenheit Temperature in Celcius

Description:

In C++ 'float' (data type) is used for decimal numbers. And 'int' (data type) is used for integer numbers.

Code:


#include<iostream>
#include<conio.h>
#include<iomanip>
using namespace std;
int main()
{
    float c,f,a;
    xy:
    cout<<"Enter the value of temperature in Fahrenheit"<<endl;
    cin>>f;
    c=(f-32)*5/9;
    cout<<endl<<"The value of temperature in celsius degrees is"<<endl<<c<<endl;
    goto xy;
    getche();
 
    }


Output:


No comments:

Post a Comment