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

Read the following quotation. All the territorial possessions of all the political establishments in the earth–including America, of course–consists of pilferin
Which of the following has a positive acceleration? A. A car sits at rest at a stop sign. B. A car is slowing down as it approaches a traffic light. a C. A car
Explain the term: "Team spirit is the right spirit"
is any energy released during atp hydrolysis and if so, how much?
Please help me answer this question
I just need number 9
12. Write a thesis statement for the following topic: Pet adoption ⚠️I NEED IT RN⚠️
jane frequently sleepwalks and talks in her sleep. during which part of a night’s sleep would jane most likely show these behaviors?
How does power influence colonization in North America? give 5 reasons
Which of the following is not formatted properly?