Re: Program will add but cannot get it to multiply



On 31 Jan 2006 12:38:22 -0800, "shannon" <shannondingle@xxxxxxxxxxxxx>
wrote, quoted or indirectly quoted someone who said :

> int sum = 0;
>
> for ( int number = 0; number <=100; number +=2 )
> sum += number;

you mean this/
Try it with 9 and see if your code works. You may be pleasantly
surprised. A repeating multiplication is called a sum not a product.

What you are doing is very similar to computing a factorial and runs
into the same problem with the answers being too big.

see .http://mindprod.com/jgloss/factorial.html
--
Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.
.