#include <iostream>
using namespace std;
class Temperature
{
    float centigrade, fahrenheit ;
public:
    Temperature()
    {
        centigrade=0.0;
    }
    void GetTemp();
    void Conversion();
    void print();
};
void Temperature::GetTemp()
{
    cout << endl << "Enter temperature in centigrade:" ;
    cin >> centigrade;
}
void Temperature::Conversion()
{
    fahrenheit = ((9*centigrade)/5) + 32 ;
}
void Temperature::print()
{
    cout << endl << "Temperature in Centigrade=" << centigrade <<
 endl << "Temperature in Fahrenheit=" << fahrenheit << endl ;
}
int main()
{
    Temperature t1;
    t1.GetTemp();
    t1.Conversion();
    t1.print();
    return 0;
}
C and C++ programs, games, softwares. Easy programming guide. Learn to code and enjoy coding in CoderNepal
Home » T.U.2066 » C++ code to Convert Centigrade to Fahrenheit
Monday, April 17, 2017
C++ code to Convert Centigrade to Fahrenheit
This is the solution to convert Centigrade into Fahrenheit (T.U. 2066)
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment