Answer:
# include<iostream>
#include<conio.h>
using namespace std;
main()
{
int mathmarks[10];
int highestmarks = 100;
int check =0;
for(int i= 1; i<=10; i++)
{
cout<<"\\Marks of student "<<i<<"in maths =";
cin>>mathmarks[i];
}
for (int j= 1 ; j<=10; j++)
{
if (mathmarks[j] == highestmarks)
{
check = 1;
break;
}
}
if (check = 1)
{
cout<<"The student having 100 marks in class having roll # ="<<j;
}
else
{
cout<<"No Student Have 100 Marks in Class";
}
getch();
}
Step-by-step explanation:
In this program, we need to find the student who have got 100 marks and print his roll number. if no students have 100 marks then print "No students got 100 marks in class". So, we take and integer type array named mathmarks of size 10. Two integer variables named highestmarks to store 100 and check to check the condition in if else. Initially check = 0, if we found the student having 100 marks then this will be updated as 1 and we print our required output, else we print no student got 100 marks.