[Cialug] Algorithm

Dave Weis cialug@cialug.org
Fri, 14 Jan 2005 16:10:29 -0600 (CST)


On Fri, 14 Jan 2005, David Stout wrote:

> Without using logic just integer arithmetic what would the algorithm be 
> for finding how many quarters, dimes, nickles & penneys in .92.

I would start by using modulo arithmetic on the number of cents in each 
coin to determine the number, then subtract the value as you go, ending up 
with pennies.

Good luck on your homework.

-- 
Dave Weis             "I believe there are more instances of the abridgment
djweis@sjdjweis.com   of the freedom of the people by gradual and silent
                       encroachments of those in power than by violent
                       and sudden usurpations."- James Madison