Ask Question
29 May, 01:14

Design the logic for a program that allows a user to enter 20 numbers, then displays all of the numbers, the largest number, and the smallest.

+4
Answers (1)
  1. 29 May, 04:12
    0
    Logic of the program:

    Step 1: START

    Step 2: Set Integer data type array variable with size 20.

    Step 3: Get input from the user in the array variable.

    Step 4: Print the array variable

    Step 5: Set integer variable "Maximum" in which we store the array index 0

    Step 6: Set integer variable "Minimum" in which we store the array index 0

    Step 7: Again set an integer variable "i" to 0

    Step 8: Set the while loop and pass condition the variable "i" is less than 20

    Step 9: Then, set the if conditional statement and check array[i] is greater than the variable "Maximum" then,

    Step 10: Initialize the value of array[i] in the variable "Maximum" i. e., Maximum = array[i]

    Step 11: Again set the if conditional statement and check array[i] is less than the variable "Minimum" then,

    Step 12: Initialize the value of array[i] in the variable "Minimum" i. e., Minimum = array[i].

    Step 13: END the IF condition.

    Step 14: Increment in the variable "i" by 1 i. e., i = i+1

    Step 15: END the WHILE loop

    Step 16: Print the value of the variable "Maximum"

    Step 17: Print the value of the variable "Minimum"
Know the Answer?
Not Sure About the Answer?
Get an answer to your question ✅ “Design the logic for a program that allows a user to enter 20 numbers, then displays all of the numbers, the largest number, and the ...” 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