Answered step by step
Verified Expert Solution
Question
1 Approved Answer
47) Define an integer ( i ), an integer array called score with 5 elements, and an integer max. Prompt the user to enter 5
47) Define an integer \\( i \\), an integer array called score with 5 elements, and an integer max. Prompt the user to enter 5 scores with the prompt "Enter 5 scores: ". Read in a value from the keyboard into the \\( 0^{\\text {th }} \\) element of the array. Set the max to the \\( 0^{\\text {th }} \\) element of the array. Then create a for loop that uses an integer \\( \\mathrm{i} \\) to run from 1 to 5 . Inside the loop read in a value into the ith element of the array. Check to see if the value in the array is greater than max. If so, set max to the new value
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started