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

What percent of 200 is 6?
How did alexander hamilton have an influence on bringing the united states to a modern era economically?
Which of the following was the moral message in much of George Catlin’s work? a. Destruction of the natural environment is against God’s will. b. American westw
Use redlining in a sentence
What is 70/800 as a terminating Decimal
order from greatest to least 5.006 5.917 5.08 5.99
What was the main purpose of the Interstate Commerce Act of 1887?
2.Which events were most responsible for causing the South to secede?
how do macrophages protect your body from infection?
What is a kremlin? a. a walled fortress designed to protect a Russian city b. a multi-domed cathedral at the heart of a Russian city c. a palace where the tsar