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

Find the unknown angle
candy lives in the center of town. her friend darlene lives 28 miles to the east and her friend dana lives 21 miles north. approximately how far do dana and dar
What are synonyms for the word “jukebox”?
In the geometric progression –3, 12, −48… what term is 3,072?
write an equation of the line that passes through 9,2 and is parallel to the line y=5/3x+9
Which type of organism is missing from the food web seen in the illustration? Primary consumers Decomposers Primary producers Secondary consumers
how do I simplify this
A computer store bought a program at a cost of $10 and sold it for $13. Find the percent markup
. How do the UV rays cause damage? What exactly causes the skin to burn; can you please be more specific about this mechanism? 3. How do photosensitive medicati
Write the expression 7x^3-28xy^2 as the product of 3 factors