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

I NEED HELP ASAP!!!! What is the value of x? Enter your answer in the box. x =
Which expression is equivalent to ?​
The polynomial below is perfect square trinomial of the form a^2 -2AB +B^2
Find the values of x and y. Thanks.
Who invented the clavichord?
What is the inverse of the following conditional statement? * If our team won the game, then we are the state champions*
draw a fraction that is equivalent to 1/6​
The treaty of Paris officially ended the American Revolution in 1783. What was the most significant part of this document to world history? A) The fighting bet
Help please ????????
Which two sentences clearly show that the purpose of the passage is to instruct? How to Draw To learn how to draw you need the right instruments. You can choose