I'm working on an algorithm that finds the smallest element among a, b, and c.(adsbygoogle = window.adsbygoogle || []).push({});

Here is what I have so far:

Input: a,b,c

Output: small; smallest element in the sequence a,b,c

a = 2, b = 4, c = 3

Small = a

If b < small, then small = b

If c < small, then small = c

Is this right?

**Physics Forums | Science Articles, Homework Help, Discussion**

Dismiss Notice

Join Physics Forums Today!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# Homework Help: Algorithm to find smallest element

**Physics Forums | Science Articles, Homework Help, Discussion**