You are on page 1of 1

#include<iostream>

#include<conio.h>
using namespace std;

int DisplayMenu (float cm)
{
cout<<"**Choose Conversion**"<<endl;
cout<<"[1] Meters\n";
cout<<"[2] Inch/es\n";
cout<<"[3] Foot\n";
cout<<"Enter choice: ";

}
void GetMeter(float cm)
{
cout<<cm<<" is equal to "<<cm/100<<endl;

}
void GetInches(float cm)
{
cout<<cm<<" is equal to "<<cm*2.54<<endl;

}
void GetFoot(float cm)
{
cout<<cm<<" is equal to "<<cm/30.48<<endl;

}
main()
{
int choice;
float cm,centi;
float a,b,c;
cout<<"Enter CM: ";
cin>>cm;
centi=DisplayMenu(cm);
cin>>choice;

if(choice==1)
GetMeter(cm);
else if(choice==2)
GetInches(cm);
else if(choice==3)
GetFoot(cm);


getch();
}

You might also like