#include<iostream>
using namespace std;
main()
{ int max,min;
int marks[5];
string name[5];
for(int a=0;a<5;a++)
{
cout<<"enter name of roll number "<<a+1<<endl;
cin>>name[a];
cout<<"Enter marks of student"<<endl;
cin>>marks[a];}
min=max=marks[0];
for(int a=0;a<5;a++)
{
if(max<marks[a])
max=marks[a];
if(min>marks[a])
min=marks[a];}
cout<<"maximum marks are "<<max<<endl;
cout<<"minimum marks are "<<min;
}
No comments:
Post a Comment