sarahsatan1473 sarahsatan1473
  • 02-04-2021
  • Computers and Technology
contestada

(TCO 4) The following function returns the _____ of the array elements. int mystery(int a[], int n) { int x=a[0]; for (int i=1; i

Respuesta :

Jamesanny20
Jamesanny20 Jamesanny20
  • 03-04-2021

Answer:

Answered below.

Explanation:

The function returns the largest of n number of elements in the array.

It takes an int array parameter int[] a, and an integer parameter n. It then assigns the first element of the array to an integer variable X.

The for loop begins at the second element of the array and loops less than n number of times. In each iteration, it checks if the element is greater than X and swaps it with X.

The function finally returns X.

Answer Link

Otras preguntas

Please explain your work!
What is a net and how can you use it to help you find the surface area of a 3-Dimensional figure? 84 points for brainliest!
Why are alloys useful?​
The revenues and expenses of Paradise Travel Service for the year ended May 31, 2018, follow: Accounts Fees earned $1,430,000 Office expense 305,000 Miscellaneo
Which graph has the same rate of change as the equation y=2x+3
Function f is an increasing exponential function that is negative on the interval (-∞, 2) and positive on the interval (2, ∞). Which could be the graph of funct
solve for a side in right triangles
Ann and tom want to establish a fund for their grandson's college education. What lump sum deposit at a 12.7% annual interest rate compounded annually interest
write an expression,using an exponent,that is equivalent to 6×6×6×6×6​
What’s the correct answer for this?