Please help me what is wrong in my code?

#include<iostream>
using namespace std;
int main ()
{
double sub1,sub2,sub3,sub4;
float avg;

cout<<"Enter your grade in CC 113A: ";
cin>>sub1;
cout<<"Enter your grade in CC 113B: ";
cin>>sub2;
cout<<"Enter your grade in CC 113: ";
cin>>sub3;
cout<<"Enter your grade in IT 113: ";
cin>>sub4;
avg = (sub1 + sub2 + sub3 + sub4)/4;
cout<<"Your Average is: "<<avg<<endl;


if(avg>85 && avg<=93)
{
cout<<"Your average is Outstanding. You can be a Dean's Lister.";
}
else if(avg>75 && avg<=84)
{
cout<<"Your average is Good. Work harder to be recognized next time.";
}
else(avg<=74)
{
cout<<"Your average is Failed. Please prioritize your studies.";
}



return 0;

}
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
#include<iostream>
using namespace std;
int main ()
{
    double sub1,sub2,sub3,sub4;
    float avg;
    
    cout<<"Enter your grade in CC 113A: ";
    cin>>sub1;
    cout<<"Enter your grade in CC 113B: ";
    cin>>sub2;
    cout<<"Enter your grade in CC 113: ";
    cin>>sub3;
    cout<<"Enter your grade in IT 113: ";
    cin>>sub4;
    avg = (sub1 + sub2 + sub3 + sub4)/4;
    cout<<"Your Average is: "<<avg<<endl;
    
    
    if(avg>85 && avg<=93)
    {
        cout<<"Your average is Outstanding. You can be a Dean's Lister.";
    }
    else if(avg>75 && avg<=84)
    {
        cout<<"Your average is Good. Work harder to be recognized next time.";
    }
    else//(avg<=74) <----
    {
        cout<<"Your average is Failed. Please prioritize your studies.";
    }
    
    
    
    return 0;
    
}
Topic archived. No new replies allowed.