From 0e7af900b9564def821369a4143fa8da68345b5b Mon Sep 17 00:00:00 2001 From: smit1010 <72179697+smit1010@users.noreply.github.com> Date: Thu, 1 Oct 2020 09:35:22 +0530 Subject: [PATCH] Update 17)factorial.c --- 17)factorial.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/17)factorial.c b/17)factorial.c index 77d5403..bd2c607 100644 --- a/17)factorial.c +++ b/17)factorial.c @@ -1,17 +1,17 @@ #include int factorial(int); -main() +void main() { int num,result; printf("Enter the number :\n"); - scanf("%d",&num); + scanf("%d", &num); if(num<0) { - printf("It is not possible\n"); + printf("It is not possible\n"); //not posible beacuse negative value not posible in factorial } else { - result=factorial(num); + result = factorial(num); printf("The factorial of %d is: %d\n",num,result); } } @@ -19,11 +19,11 @@ int factorial(int num) { if(num==0||num==1) { - return 1; + return 1; } else { - return (num*factorial(num-1)); + return (num*factorial(num-1)); } - + }