Answer to Question #31598 in C++ for MANMOHAN SHARMA

Question #31598
2. "Write a function for finding out highest and lowest marks obtained by a student from an array contained student name and marks".

For Example :

GetHighestLowestMarks{Student{n}, Marks{n}} returns an arraycontain student name and marks.
1
Expert's answer
2013-06-06T09:41:29-0400
#include <iostream>

using namespace std;
int fun()
{
& int a[10];
& cout<<"enter student name"<<endl;
& char r[10];
& cin>>r;
& cout<<"enter 10 student marks"<<endl;

for(int i=0;i<10;i++){
cin>>a[i];
}


& int max=0;
& int min;
& for(int j=0;j<10;j++)
& {

if (min>a[j]) {min=a[j];}

if (max<a[j]) {max=a[j];}

& }
& cout<<endl<<r<<endl<<"min= "<<min<<endl<<"max= "<<max<<endl;
}
int main()
{
fun();

return 0;
}


Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS