
-----------------------------------
cool dude
Tue Jun 13, 2006 7:31 pm

too big numbers
-----------------------------------
a question that i'm doing is this:


Problem 20

n! means n Ã— (n &#8722; 1) Ã— ... Ã— 3 Ã— 2 Ã— 1

Find the sum of the digits in the number 100!



the problem with this is that the sum is too big(unless i did something wrong) thus it keeps displaying 0. is there any way to fix that?


public class Problem20 {
	public static void main (String[] args){
		int n = 100;
		int total = 100;
		int sum = 0;
		
		for (int i = 1; i 