186k views
3 votes
Which logic correctly describes an algorithm to find the smallest of the three numbers a, b, and c and store the smallest number in small?

A.
If a is less than b, then set a to small, else set b to small, else set c to small.
B.
If a is less than b, then set small to a, else set small to b.
If c is less than small, then set small to c.
C.
If a is less than b, then set small to b, else set small to c.
If c is less than small, then set small to a.
D.
If a is less than small, then set small to a.
If b is less than small, then set small to b.
If c is less than small, then set small to c.

User Efog
by
5.8k points

2 Answers

5 votes

Answer:

D

Step-by-step explanation:

User Meikiem
by
5.1k points
3 votes

Answer:

B. If a is less than b, then set small to a, else set small to b.

If c is less than small, then set small to

Step-by-step explanation:

Plato correct!!

User Pratpor
by
5.9k points