forked from Sushreesatarupa/DSA-cpp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgrade calculator.cpp
More file actions
48 lines (45 loc) · 1.07 KB
/
grade calculator.cpp
File metadata and controls
48 lines (45 loc) · 1.07 KB
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
#include<iostream>
using namespace std;
int main()
{
int marks[5], i;
float sum=0,avg;
cout<<"\n Enter Marks of Student \n";
cout<<"------------------------------------";
cout<<"\n Hindi : ";
cin>>marks[0];
cout<<"\n English : ";
cin>>marks[1];
cout<<"\n Maths : ";
cin>>marks[2];
cout<<"\n History : ";
cin>>marks[3];
cout<<"\n Science : ";
cin>>marks[4];
for(i=0;i<5;i++)
{
sum=sum+marks[i];
}
cout<<"------------------------------------";
cout<<"\n Total Marks of Student = "<<sum;
avg=sum/5;
cout<<"\n Average = "<<avg;
cout<<"\n Grade = ";
if(avg>80)
{
cout<<"A";
}
else if(avg>60 && avg<=80)
{
cout<<"B";
}
else if(avg>40 && avg<=60)
{
cout<<"C";
}
else
{
cout<<"D";
}
return 0;
}