48:2: error: expected unqualified-id before 'return'.....please help! thank you

My program is supposed to determine what a user's letter grade is from an input value, but it won't run because if this error:
48:2: error: expected unqualified-id before 'return'
--please help me fix it, I would greatly appreciate it. Thank you!

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
  #include <iostream>

/* run this program using the console pauser or add your own getch, system("pause") or input loop */

using namespace std;
int main() 

{


    char Answer;
    int GradeValue;
    
    cout << "Enter a Grade Value: \t";
        cin >> GradeValue;
    
    do {
            if (GradeValue <60)
                cout << "You earned an F for failure. Sad. Better luck next time."<<endl;
            if (GradeValue >=60 && GradeValue< 63)
                cout << "You earned a D-. Meh, at least you didn't fail!"<<endl;
            else if (GradeValue >=63 && GradeValue <67)
                cout << "You earned a D. Better than a D-."<<endl;
            else if (GradeValue >=67 && GradeValue <70)
                cout<< "You earned a D+. Hit the books!"<<endl;
            else if (GradeValue >=70 && GradeValue <73)
                cout << "You earned a C-. You're getting there!"<<endl;
            else if (GradeValue >=73 && GradeValue <77)
                cout << "You earned a C. Better than a C-!"<<endl;
            else if (GradeValue >=77 && GradeValue <80)
                cout << "You earned a C+. Keep at it!"<<endl;
            else if (GradeValue >=80 && GradeValue <83)
                cout << "You earned a B-. You're getting up there!"<<endl;
            else if (GradeValue >=83 && GradeValue < 87)
                cout << "You earned a B. Good!"<<endl;
            else if (GradeValue >=87 && GradeValue <90)
                cout << "You earned a B+. Keep it up!"<<endl;
            else if (GradeValue >=90 && GradeValue < 93)
                cout << "You earned an A-. Nice job!"<<endl;
            else if (GradeValue >=93 && GradeValue < 97)
                cout << "You earned an A. Awesome!"<<endl;
            else if (GradeValue >=97 && GradeValue <=100)
                cout << "You got an A+. Can I be you?!?!"<<endl;
    }
            
    while (Answer=='y');
}
	return 0;
Last edited on
your return statement is outside the main function.
Topic archived. No new replies allowed.