I'm fourteen trying this on my own for the first time.
Yes it is for my junior high math class. I am having a few issues.. I have cleared many of my issues up after I found I had left out a lot of {{ type things..
Any help would be greatly appreciated

I am trying to get Euclids lowest common denominator to work

Now I get two error messages:
line 4 invalid function declaration
line 45 expected unqualified-id "{'

Here is my program

#include<iostream>
#include<iomanip>

usingstd: :cout:
usingstd: :cin:
usingstd: :end1:
usingstd: :setw:

int main()
{
    int dividend, divisor, remainder, num1, num2 = 0;

    cout << "This program finds the GCF of two numbers." << end1 << end1;

    cout << "Enter the first number.";
    cin >> num1;
    cout << end1 << end1;

    cout <<"Enter the second number.";
    cin >> num2;
    cout << end1 << end1;

    if(num1 > num2)
    {
            Dividend=num1;
            Divisor=num2;
    }

    else
    {
            Dividend=num2;
            Divisor=num1;
    }

    do(
            Remainder=dividend%divisor;

            If(remainder !=0)
            {
                  Dividend=divisor;
                  Divisor=remainder;
            }

            }
            {while (remainder !=0); //loop until remainder is zero


    cout << "The GCF of " << num1 << "and" << num2 << "is": << divisor << end1 <<end1;
    cout << setw(15) << "Proof:" << end1 << end1;

    cout << "GCF" << end1;
    cout << setw(2) << divisor << "*" << num1/divisor << "=" << (num1/divisor)*divisor << end1
    cout << setw(2) << divisor << "*" << num2/divisor << "=" << (num2/divisor)*divisor << end1 << end1;

    system("Pause");
    return 0:
}

Edited 3 Years Ago by Reverend Jim: Fixed formatting

usingstd: :cout:
usingstd: :cin:
usingstd: :end1:
usingstd: :setw:

Surely you meant:

using std::cout:
using std::cin:
using std::endl:
using std::setw:

But since your program is so small it would be wise to: using namespace std; !
This shall not pass:

cout << end1 << end1;

It is "end" "L"

cout << endl << endl;

And finally the syntax for the do-while loop is:

do{
//...stuff
}while( /* condition */ );

So this needs to be a curly brace/bracket/{

do(

Edited 5 Years Ago by pseudorandom21: n/a

This article has been dead for over six months. Start a new discussion instead.