Answer to Question #14274 in C++ for zyrus santillan

Question #14274
4. Write a C++ program that would input 10 scores and output the Highest and Lowest score.
1
Expert's answer
2012-09-06T10:54:23-0400
#include <iostream>
using namespace std;
int main()
{
int a[10],max,min;
for (int i=0; i<10;i++){

cout<<"\n& "<<i+1<<" Enter the score : ";
cin>>a[i];
& }
max=min=a[0];
for (int i=0; i<10;i++){
if (max<a[i])
max=a[i];
if (min>a[i])
min=a[i];
& }
cout<<"max = "<<max<< " \n";
cout<<"min = "<<min<< " \n\n\n";

system("PAUSE");
}

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
APPROVED BY CLIENTS