Question
Receive 3 numbers and display them in ascending order from smallest to largest using pseudocode
Answers
START
// Receive 3 numbers
INPUT num1, num2, num3
// Sort numbers in ascending order
IF num1 > num2
SWAP num1 and num2
END IF
IF num2 > num3
SWAP num2 and num3
END IF
IF num1 > num2
SWAP num1 and num2
END IF
// Display numbers in ascending order
DISPLAY num1, num2, num3
END
// Receive 3 numbers
INPUT num1, num2, num3
// Sort numbers in ascending order
IF num1 > num2
SWAP num1 and num2
END IF
IF num2 > num3
SWAP num2 and num3
END IF
IF num1 > num2
SWAP num1 and num2
END IF
// Display numbers in ascending order
DISPLAY num1, num2, num3
END
Related Questions
Step 1: Design a flowchart or write pseudocode for a program that allows a user to enter 12 numbers...
Pseudocode and flowchart to create a program to find the smallest and largest value among 100 number...
Receive 3 numbers and display them in ascending order from smallest to largest using flowchart?
identify the ascending numerical order of these fractions and mixed numbers from smallest to largest...