Ask Question
11 August, 03:00

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.

+4
Answers (1)
  1. 11 August, 05:18
    0
    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
Know the Answer?
Not Sure About the Answer?
Get an answer to your question ✅ “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 ...” in 📙 Computers & Technology if there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers