Given is the array prices with 100 elements(prices[100]). The problem consists of two parts: 1. Find the highest price in the array; and 2. Reduce that price by 10% For any three numbers input by the user, output the numbers in ascending order.

Respuesta :

Answer:

1. Input array of 100 numbers

mx = 0

for (int i = 0; i < 100; i++)

  if (arr[i] > mx)

      mx = arr[i]

Output mx

2. Input array of 100 numbers

mx = 0

for (int i = 0; i < 100; i++)

  if (arr[i] > mx)

      mx = arr[i]

mx = mx * 0.9

3. Input three numbers

if(firstNumber > secondNumber) {

swap(firstNumber, secondNumber)

}

if (firstNumber > thirdNumber) {

swap(firstNumber, thirdNumber)

}

if (secondNumber > thirdNumber) {

swap(secondNumber, thirdNumber)

}

output firstNumber, secondNumber, thirdNumber

Explanation: