Write an algorithm that accepts four numbers as input and find the largest and smallest of them.
Answers
Answered by
2
Answer:
Solution
verified
Verified by Toppr
INPUT a, b, c, d
SET minn := a, maxx := a
IF b < minn THEN
minn : = b
END IF
IF c < minn THEN
minn := c
END IF
IF d < minn THEN
minn := d
END IF
IF b > maxx THEN
maxx := b
END IF
IF c > maxx THEN
maxx := c
END IF
IF d > maxx THEN
maxx : =d
END IF
PRINT minn, maxx
Explanation:
Similar questions
Math,
5 months ago
French,
5 months ago
Math,
10 months ago
Science,
10 months ago
Computer Science,
1 year ago
Computer Science,
1 year ago