Type the output for the given program when the input is
1
7
10
9
6
#include <iostream>
using namespace std;
int FindScore(const int scoreVals[], int numVals) {
int i;
int returnVal = scoreVals[0];
for (i = 1; i < numVals; ++i) {
if (scoreVals[i] < returnVal) {
returnVal = scoreVals[i];
}
}
return returnVal;
}
int main() {
const int NUM_SCORES = 5;
int quizScores[NUM_SCORES];
int i;
int returnScore;
for (i = 0; i < NUM_SCORES; ++i) {
cin >> quizScores[i];
}
returnScore = FindScore(quizScores, NUM_SCORES);
cout << returnScore << endl;
return 0;
}
The answer to your question is provided in the image:
Comments
Leave a comment