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
English,
4 months ago
Science,
4 months ago
English,
4 months ago
Math,
9 months ago
Science,
9 months ago
Computer Science,
1 year ago
Computer Science,
1 year ago