Skip to content

Commit

Permalink
Merge pull request ZoranPandovski#739 from adityauser/patch-4
Browse files Browse the repository at this point in the history
Increased Range of factorial
  • Loading branch information
ZoranPandovski authored Oct 31, 2017
2 parents b37d5ad + 688fb5c commit 4453477
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions math/factorial/C/factorial.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include<stdio.h>

long long fact(long long x)
unsigned long long fact(unsigned long long x)
{
if(x > 1)
return x*fact(x-1);
Expand All @@ -9,9 +9,9 @@ long long fact(long long x)

int main(void)
{
int n, t, s=0, r;
unsigned int n, t, s=0, r;
printf("Enter the number: ");
scanf("%d", &n);
printf("\nFactorial of the number is: %lld",fact(n));
scanf("%u", &n);
printf("\nFactorial of the number is: %llu",fact(n));
return 0;
}
}

0 comments on commit 4453477

Please sign in to comment.