95{
96 int number, i;
97
98
99 if (argc == 2)
100 number = atoi(argv[1]);
101 else
102 {
103 printf("Enter the value of n(n starts from 0 ): ");
104 scanf("%d", &number);
105 }
106
108
109 clock_t start_time = clock();
110 for (i = 2; i <= number; i++)
112 double time_taken = (clock() - start_time) * (double)1e3 / CLOCKS_PER_SEC;
113
114
115 printf("%d! = ", number);
117 putchar(result->
digits[i - 1] +
'0');
118 printf("\nTime taken: %.4g ms\n", time_taken);
119
121 return 0;
122}
large_num * new_number(void)
create a new large number
Definition: factorial_large_number.c:24
void multiply(large_num *num, unsigned long n)
multiply large number with another integer and store the result in the same large number
Definition: factorial_large_number.c:66
dynamically large number
Definition: factorial_large_number.c:15