there. I'm self learning C++ out of "C++ without fear". There is an exercise dealing with the GCD of 2 numbers that asks to print "GCD(a,b) =>" at each step in the proceedure. I was able to get this working:
int gcd (int a, int b);
int main() {
    int i,j;
    cout << "Enter the first integer" << endl;
    cin >> i;
    cout << "Enter the second integer" << endl;
    cin >> j;
    int k = gcd(i,j);
    cout << "The GCD is " << k << endl; 
    system("PAUSE");
    return 0;
}
int gcd (int a, int b){
    if(b==0){
        cout << "GCF(" << a;
        cout << "," << b;
        cout << ") => " <<endl;
        return a;
    }
    else {
        cout << "GCF(" << a;
        cout << "," << b;
        cout << ") => " << endl;
        return gcd(b,a%b);
    }
}
I was just wondering if there is a nicer way to go about printing each step of finding the GCD. That is, is there a "nicer" way to write this part of the code:
     cout << "GCF(" << a;
     cout << "," << b;
     cout << ") => " << endl;
? Thanks in advance.
 
     
     
     
     
    