yaa357621 yaa357621
  • 19-05-2022
  • Computers and Technology
contestada

6. Write a C++ program to print the largest three elements in an array.
​

Respuesta :

basantisangma
basantisangma basantisangma
  • 19-05-2022

Answer:

if (arr[i] > max) -> max3 = max2, max2 = max , max = arr[i]. else if (arr[i] > max2) -> max3 = max2, max2 = arr[i]. else if (arr[i] > max3) -> max3 = arr[i]. At the end of the loop, we will print all three values.

Answer Link

Otras preguntas

For an average adult the surface area of the skin is about 19,000 square cm and the thickness of the skin ranges from about 0.5mm to 4mm. To put this in perspe
What are the lengths of the legs of a right triangle in which one acute angle measures 19o and the hypotenuse is 15 units long?
find value of x and y 4.)2x-3y=-15 x=4y
The triangles are similar. If DE = 12, EF = 10, and BC = 5, find AB.
find the sum of the multiples of 3 from 3 to 99 inclusive
what's the square root of 9
The measure of one angle of a parallelogram is 40 more than 3 times another. Find the measure of each angle.
find the missing endpoint given one endpoint and midpoint endpoint-(6,-10) midpoint (-1,2)
What Is The Slope Of A Line parallel to y = -2/5x + 4/5
Sam is 5 years old. His older brother, Tom, is three times as old as Sam. When Sam is 20, how old will Tom be?