2013-06-05T07:35:16-04:00
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
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 !
Learn more about our help with Assignments:
C++
Comments