From b7b76ad8b4a3e26caddfa8de262cb6ad596e7c57 Mon Sep 17 00:00:00 2001 From: biratkundu <72906658+biratkundu@users.noreply.github.com> Date: Sat, 17 Oct 2020 10:04:51 +0530 Subject: [PATCH] Create factorial.cpp --- samples/factorial.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 samples/factorial.cpp diff --git a/samples/factorial.cpp b/samples/factorial.cpp new file mode 100644 index 00000000..6ca575ce --- /dev/null +++ b/samples/factorial.cpp @@ -0,0 +1,13 @@ +#include +using namespace std; +int main() +{ + int i,fact=1,number; + cout<<"Enter any Number: "; + cin>>number; + for(i=1;i<=number;i++){ + fact=fact*i; + } + cout<<"Factorial of " <