-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathagregate finder.cpp
105 lines (105 loc) · 3.55 KB
/
agregate finder.cpp
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
#include<iostream>
using namespace std;
int main()
{
int roll1, roll2, roll3, roll4, roll5, roll1a, roll1b, roll1c, roll1d, roll1e, roll2a, roll2b, roll2c, roll2d, roll2e, roll3a, roll3b, roll3c, roll3d, roll3e, roll4a, roll4b, roll4c, roll4d, roll4e, roll5a, roll5b, roll5c, roll5d, roll5e;
{
cout << "Please enter first student roll no. : "; getchar;
cin >> roll1;
cout << "Enter Subject A result : ";
cin >> roll1a;
cout << "Enter Subject B result : ";
cin >> roll1b;
cout << "Enter Subject C result : ";
cin >> roll1c;
cout << "Enter Subject D result : ";
cin >> roll1d;
cout << "Enter Subject E result : ";
cin >> roll1e;
}
{
cout << "Please enter Second student roll no. : "; getchar;
cin >> roll2;
cout << "Enter Subject A result : ";
cin >> roll2a;
cout << "Enter Subject B result : ";
cin >> roll2b;
cout << "Enter Subject C result : ";
cin >> roll2c;
cout << "Enter Subject D result : ";
cin >> roll2d;
cout << "Enter Subject E result : ";
cin >> roll2e;
}
{
cout << "Please enter Third student roll no. : "; getchar;
cin >> roll3;
cout << "Enter Subject A result : ";
cin >> roll3a;
cout << "Enter Subject B result : ";
cin >> roll3b;
cout << "Enter Subject C result : ";
cin >> roll3c;
cout << "Enter Subject D result : ";
cin >> roll3d;
cout << "Enter Subject E result : ";
cin >> roll3e;
}
{
cout << "Please enter Forth student roll no. : "; getchar;
cin >> roll4;
cout << "Enter Subject A result : ";
cin >> roll4a;
cout << "Enter Subject B result : ";
cin >> roll4b;
cout << "Enter Subject C result : ";
cin >> roll4c;
cout << "Enter Subject D result : ";
cin >> roll4d;
cout << "Enter Subject E result : ";
cin >> roll4e;
}
{
cout << "Please enter Fifth student roll no. : "; getchar;
cin >> roll5;
cout << "Enter Subject A result : ";
cin >> roll5a;
cout << "Enter Subject B result : ";
cin >> roll5b;
cout << "Enter Subject C result : ";
cin >> roll5c;
cout << "Enter Subject D result : ";
cin >> roll5d;
cout << "Enter Subject E result : ";
cin >> roll5e;
}
int a, b, c, d, e;
(a = roll1a + roll1b + roll1c + roll1d + roll1e);
(b = roll2a + roll2b + roll2c + roll2d + roll2e);
(c = roll3a + roll3b + roll3c + roll3d + roll3e);
(d = roll4a + roll4b + roll4c + roll4d + roll4e);
(e = roll5a + roll5b + roll5c + roll5d + roll5e);
{
if (a>b && a>c && a>d && a>e)
{
cout << "" << roll1 << " has highest aggregate of " << a << "" << endl;
}
else if (b>a && b>c && b>d && b>e)
{
cout << "" << roll2 << " has highest aggregate of " << b << "" << endl;
}
else if (c>a && c>b && c>d && c>e)
{
cout << "" << roll3 << " has highest aggregate of " << c << "" << endl;
}
else if (d>a && d>b && d>c && d>e)
{
cout << "" << roll4 << " has highest aggregate of " << d << "" << endl;
}
else
{
cout << "" << roll5 << " has highest aggregate of " << e << "" << endl;
}
}
return 0;
}