void menuFunction()
{
int choice, num1, num2, den1, den2, numres = 0, demres = 0;
{
cout<<"This program performs operations on fraction."<<endl;
cout<<"1 : To add fraction"<<endl;
cout<<"2 : To subtract fraction"<<endl;
cout<<"3 : To multiply fraction"<<endl;
cout<<"4 : To divide fraction"<<endl;
cout<<"9 : To exit the program"<<endl;
cout<<"\nPlease Enter Your Choice: " ;
cin >> choice;
if ( (choice ==1) || (choice ==2) || (choice ==3) || (choice ==4) )
{
cout <<"\nFor fraction 1" << endl;
cout << "Enter the numerator: ";
cin >> num1;
cout << "Enter the denominator: ";
cin >> den1;
if (den1 ==0)
{
cout << "Denominator must be nonzero\n";
cout << "Enter the denominator: ";
cin >> den1;
}
cout <<"\nFor fraction 2" << endl;
cout << "Enter the numerator: " ;
cin >> num2;
cout << "Enter the denominator: " ;
cin >> den2;
if (den2 ==0)
{
cout << "Denominator must be nonzero\n";
cout << "Enter the denominator: ";
cin >> den2;
}
}
_____________________________________________________________________________
i done it
fully thks for your help
its 3:05am (Malaysia)
have to sleep now =]
good nite
haha