the best i can think of right now because you don't say exactly what you want to do
is this code

Code:
#include <iostream>
#include <ctime>
using namespace std;

class Fraction{
   private:
            int num; // Numerator
            int den; // Denominator
    public:
            void setRandomFraction() {
                    num = rand() % 9 + 1;                                   
                    den = rand() % 9 + 1;                                   
            } //sets random Fraction
           
            int getNumerator(){
                return num;
            }
            int getDenominator(){
                return den;
            }  
            void print(){ //will print the fraction in the form: numerator / denominator
               cout << "The fraction is " << num << "/" << den << endl;
            }
            void Reduce(){//will reduce the fraction to lowest terms
                int d=maxCommonDivider(num,den);
                if (d<2) return;
                    num/=d;
                    den/=d;
            }
            int maxCommonDivider(int a,int b){
                int i,j,gcd=-1;
                i=abs(a);
                j=abs(b);
                while (i>0 && j>0){
                    if (i>=j)
                         i=i%j;
                    else j=j%i;
                }
                gcd=i+j;
                return gcd;
            }
            Fraction(){ // constructor
                 num=0;
                 den=1;
            }
            //~Fraction();//destructor
            Fraction(int n,int d){ // 2 Argument Constructor
                    num=n;
                    den=(d==0)? 1 :d;
            };
           
};



int main(){
    srand (time(NULL));
 int num,den,num1 = 0, den1 = 0, num2 = 0, den2 = 0;
Fraction fraction1,fraction2,result;
//create fraction 1
fraction1=Fraction::Fraction();
fraction1.setRandomFraction();
//create fraction 2
fraction2=Fraction::Fraction();
fraction2.setRandomFraction();
//gets numerators,denominators of fraction1,fraction2
num1=fraction1.getNumerator();
den1=fraction1.getDenominator();
num2=fraction2.getNumerator();
den2=fraction2.getDenominator();
//create the resulting fraction of fraction1*fraction2
result=Fraction::Fraction(num1*num2,den1*den2);
//reduces the fraction result
result.Reduce();

   cout << "What is" << num1<< "/" << den1<< "*" << num2<<"/"<<den2<<"?"<<endl; 
   cout << "enter numerator / denominator" << "  " << "Your answer must be in reduced form" << endl;
   cin >> num >> den;
   result.print();
   cin>>num;
    return 0;
}