Computer Science, asked by clashwithash2187, 9 months ago

Write an algorithm that accepts four numbers as input and find the largest and smallest of them.

Answers

Answered by bijayasedhain09
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