Code:
#include "stdafx.h"
#include <iostream>
using namespace std;
int multiply()
{
int numerator,denominator,numerator2,denominator2;
int x2,t2, x;
cout<<"Input the numerator and denominator of a fraction separated by spaces :"<<endl;
cin>>numerator;
cin>>denominator;
cout<<"Input the numerator and denominator of a fraction separated by spaces :"<<endl;
cin>>numerator2;
cin>>denominator2;
cout<<"Input instruction*_" << endl;
x2 = numerator*numerator2;
t2 =denominator*denominator2;
int a, b;
x=gcd(x2,t2);
simplify(x2, t2,x, a, b);
cout<<"("<< numerator << "/"<<denominator <<") * ("<< numerator2 <<"/"<< denominator2 <<") = " <<a << "/" << b;
cout << "\n";
}
int gcd(int x2, int y2)
{
int i;
int gcd2;
for (i=1; i<=x2; i++)
{
if((x2%i==0) && (y2%i==0))
gcd2 = i;
}
return gcd2;
}
int simplify(int x2 , int y2 ,int gcd , int a , int b )
{
a= x2/gcd;
b= y2/gcd;
return (a,b);
}
int main()
{
multiply();
system ("PAUSE");
}
why is showing always that 1>fdgfd.cpp.cpp(22): error C3861: 'gcd': identifier not found
1>fdgfd.cpp.cpp(23): error C3861: 'simplify': identifier not found