#include <iostream>
using namespace std;
class InchtoCentimeter
{
float Inch, Centimeter ;
public:
void GetInch();
void Conversion();
void print();
};
void InchtoCentimeter::GetInch()
{
cout << endl << "Enter inch:" ;
cin >> Inch ;
}
void InchtoCentimeter::Conversion()
{
Centimeter = 2.54*Inch ;
}
void InchtoCentimeter::print()
{
cout << endl << "Inch=" << Inch << endl << "Centimeter=" << Centimeter << endl ;
}
int main()
{
InchtoCentimeter d;
d.GetInch();
d.Conversion();
d.print();
return 0;
}
C and C++ programs, games, softwares. Easy programming guide. Learn to code and enjoy coding in CoderNepal
Home » T.U.2068 » C++ code to Convert Inch into Centimeter
Monday, April 17, 2017
C++ code to Convert Inch into Centimeter
This is the solution to convert Inch into Centimeter in C++ (T.U. 2068)
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment