Skip to content

Commit 1a15f77

Browse files
authored
Merge pull request #1935 from Prabsimar/patch-14
SolutionByPrabsimar.cpp
2 parents 5b77328 + c80ba3b commit 1a15f77

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#include <iostream>
2+
using namespace std;
3+
int main()
4+
{
5+
int n;
6+
cout<<"Input: ";
7+
cin>>n;
8+
int ans=1;
9+
while(n>0)
10+
{
11+
ans = ans*n;
12+
n=n-1;
13+
}
14+
cout<<"Output: "<<ans;
15+
}

0 commit comments

Comments
 (0)