#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 » Centigrade to Fahrenheit
Centigrade to Fahrenheit
This is the solution to convert Centigrade into Fahrenheit
Subscribe to:
Posts (Atom)
No comments:
Post a Comment