Answer to Question #260522 in C++ for malika

Question #260522

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;

}


1
Expert's answer
2021-11-08T05:33:26-0500

The answer to your question is provided in the image:

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