The small program below calculates factorials -but it works only up to 25. For input >=26 I get errors. How can I use bigger integers?
Code:#include <stdio.h> int main() { int c, n ; long long factorial=1; printf("Enter a number to calculate it's factorial\n"); scanf("%d", &n); for (c = 1; c <= n; c++) factorial = factorial * c; printf("Factorial of number %d = %lld\n", n, factorial); }