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

how do I solve (3+i)(3-i)
The novel Uncle Tom’s Cabin, which effectively the unfairness toward black people, was a major influence in the antislavery movement. (A) portrayed…strengthenin
What are some 5th grade science words that start with y
Why did the goverment ration goods for people to buy?
Examples of cultural diffusion in ancient Rome pertaining to government
what religion did mansa musa of mali help spread
Nick bought a video game for $55, which was 20% off the original price. what was the original price?
three snack bars contain 1/5,0.22,and 19% of their calories from fat. which snack bar contains the least amount of calories from fat ?
Does an Off-Duty Police Officer have Authority in US?
which number is 100 less than 61 tens?