The principal of the School has asked Sankey to create a tool which will analyze students score and identify subjects that students find difficult to crack. Below are scores of students for given subjects. Write a program that will take the below data and identify the subject that
students find difficult to crack
Subject's - (Max.
Marks)
Students
Meera
Subodh Kunal
Soni
Richu
Irene
Vijay
English
(60)
100
80 90
60
50
40
80
History
(40)
80
70
70
60
90
60
80
Computers
(130)
50
80
60
65
62
64
35
Mathematics
(150)
90
100
90
80
80
70
65
Science
(120)
90
80
70
80 85
65
50
Econom
(80)
60
40
70
80
95 85
75
Answers
Answer:
The principal of the School has asked Sankey to create a tool which will analyze students score and identify subjects that students find difficult to crack. Below are scores of students for given subjects. Write a program that will take the below data and identify the subject that
students find difficult to crack
answer is65
Answer:
using namespace std;
int main()
{
int n;
cin>>n;
int arr[n][n];
for (int i = 0; i < n; i++)
for (int j = 0; j < n; j++)
cin>>arr[i][j];
int a=0;
int b=0;
int mx=0;
for (int i = 0; i <n; i++) {
for (int j = 0; j < n; j++)
{
if(arr[i][j]>mx)
{
mx=arr[i][j];
a=i;
b=j;
}
}
}
for (int i = 0; i <n; i++) {
for (int j = 0; j < n; j++)
{
if( (a<n and b==1 ) and (b==i) )
cout<<"English";
if( (a<n and b==2 ) and (b==i))
cout<<"History";
if( (a<n and b==3 ) and (b==i))
cout<<"Computer";
if( (a<n and b==4 ) and (b==i))
cout<<"Mathematics";
if( (a<n and b==5 ) and (b==i))
cout<<"science";
if( (a<n and b==6 ) and (b==i))
cout<<"econmic";
}
}
}