-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathFind the greatest one
81 lines (39 loc) · 1.33 KB
/
Find the greatest one
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
/* FOE college wants to recognize the department which
has succeeded in getting the maximum number of placements
for this academic year. The departments that have participated
in the recruitment drive are CSE,ECE, MECH. Help the college find
the department getting maximum placements. Check for all the possible
output given in the sample snapshot
Note : If any input is negative, the output should be “Input is Invalid”.
If all department has equal number of placements, the output should be
“None of the department has got the highest placement”. */
#include<iostream>
using namespace std;
int main()
{
int c,e,m;
cout << "Enter the number of placements in CSE \n";
cin>>c;
cout << "Enter the number of placements in ECE \n";
cin>>e;
cout << "Enter the number of placements in MECH \n";
cin>>m;
if(c==e && c==m && e==m)
cout<<"None of the department has got the highest placement";
else
{
if(c>0 && e>0 && m>0)
{
if(c>e && c>m)
cout<<"The Highest placements is in CSE ";
else
if(e>c && e>m)
cout<<"The highest placements is in ECE";
else
cout<<"The highest placements is in MECH";
}
else
cout<<"You entered the invalid value";
}
return 0;
}