diff options
-rwxr-xr-x | productofdigits | bin | 16736 -> 16736 bytes | |||
-rw-r--r-- | productofdigits.c | 4 |
2 files changed, 2 insertions, 2 deletions
diff --git a/productofdigits b/productofdigits Binary files differindex 2b5d859..814a3c8 100755 --- a/productofdigits +++ b/productofdigits diff --git a/productofdigits.c b/productofdigits.c index fc7606d..e00b801 100644 --- a/productofdigits.c +++ b/productofdigits.c @@ -28,9 +28,9 @@ int parseNum(const char *x, int r){ printf("%s\n", x); for(int i = 0; i < len - r; i++){ // Digits in ascii start at 48 - int prod = (int) (x[i] - 48); + long long int prod = (long long int) (x[i] - 48); for(int k = i + 1; k < i + r; k++) - prod *= (int) (x[k] - 48); + prod *= (long long int) (x[k] - 48); if(prod > max) max = prod; } |