From 2fc9eeee902f047a06ec229e06032ba967d8d8b2 Mon Sep 17 00:00:00 2001 From: Anand6976 <99198439+Anand6976@users.noreply.github.com> Date: Tue, 31 Oct 2023 14:08:25 +0530 Subject: [PATCH] Create factorial.cpp --- factorial.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 factorial.cpp diff --git a/factorial.cpp b/factorial.cpp new file mode 100644 index 0000000..9ede457 --- /dev/null +++ b/factorial.cpp @@ -0,0 +1,13 @@ +#include +using namespace std; +int fact(int n) { + if ((n==0)||(n==1)) + return 1; + else + return n*fact(n-1); +} +int main() { + int n = 4; + cout<<"Factorial of "<