Question Euclids Lowest Common Demoninator

I have been working on this for a few days
I'm 14 and trying this on my own, my dad is not a computer programmer

I'm down to three errors
4 invalid function declaration
45 expected unqualified-id before '{' token
45 expected 'or' before '{' token

I have reviewed syntax for extra or missin { to no avail


Heres what I typed in...

#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:
}

Use [code][/code] tags. Fix the using statements; they need to end with a semicolon and have a space after using. All keywords are all in lower case. You have a couple different brace errors, where you have used the opposite brace or parentheses instead.
also it's endl (end-L) not end1 (end-1) There are many syntax errors here, once you've reposted we'll fix any logic errors.
Last edited on
1. One of your IF statements is capitalized
2. Using end1 instead of endl
3. WHILE loop outside of main
4. Dividend used when dividend was declared (c++ is case sensitive)
5. Same with Remainder
6. DO opened with a ( instead of a {
7. Missing ; after endl
8. : after return instead of ;
9. "is": instead of "is: "


For starters....

Please use the code formatting tools when posting.
Last edited on
Topic archived. No new replies allowed.