From a45d70a76519cdabbe21916a7720733f24c8c8e6 Mon Sep 17 00:00:00 2001 From: Sumedh08 <88959096+Sumedhp08@users.noreply.github.com> Date: Sun, 15 Sep 2024 20:28:46 +0530 Subject: [PATCH 1/2] change in factorial.c --- Example_Programs/Factorial/src/factorial.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Example_Programs/Factorial/src/factorial.c b/Example_Programs/Factorial/src/factorial.c index 1dd50dc6..aea446b5 100644 --- a/Example_Programs/Factorial/src/factorial.c +++ b/Example_Programs/Factorial/src/factorial.c @@ -3,13 +3,13 @@ int factorial(int number) { /* Return -1 for negative numbers */ - if(number < 0) + if (number < 0) return -1; /* Return 1 for 0 */ - if(number == 0) + if (number == 0) return 1; - /* Recursively calculate Factorial of the number */ - return number * factorial(number-1); + /* Recursively calculate Factorial of the number changeeeeeegit */ + return number * factorial(number - 1); } From 8654be70a38ecfa3b0e751beb406da0ad78872f6 Mon Sep 17 00:00:00 2001 From: Sumedh08 <88959096+Sumedhp08@users.noreply.github.com> Date: Sun, 15 Sep 2024 23:42:59 +0530 Subject: [PATCH 2/2] Revert "change in factorial.c" This reverts commit a45d70a76519cdabbe21916a7720733f24c8c8e6. revert --- Example_Programs/Factorial/src/factorial.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Example_Programs/Factorial/src/factorial.c b/Example_Programs/Factorial/src/factorial.c index aea446b5..1dd50dc6 100644 --- a/Example_Programs/Factorial/src/factorial.c +++ b/Example_Programs/Factorial/src/factorial.c @@ -3,13 +3,13 @@ int factorial(int number) { /* Return -1 for negative numbers */ - if (number < 0) + if(number < 0) return -1; /* Return 1 for 0 */ - if (number == 0) + if(number == 0) return 1; - /* Recursively calculate Factorial of the number changeeeeeegit */ - return number * factorial(number - 1); + /* Recursively calculate Factorial of the number */ + return number * factorial(number-1); }