Last active
April 16, 2017 18:42
-
-
Save jayant-yadav/586ae20af9a2f8f2fe1ebadb95ec2a9c to your computer and use it in GitHub Desktop.
FACT2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<iostream> | |
//#include<bits/stdc++.h> | |
using namespace std; | |
int main() | |
{ int i,j,t,n[100]; | |
cin>>t; | |
while(t--){ | |
cin>>n[i]; | |
if(n[i]==0) | |
{ cout<<"\n"<<"1";} | |
else | |
{ long int fac=1; | |
for(j=n[i];j>0;j--) | |
{ fac*=j; | |
} | |
cout<<"\n"<<fac; | |
} | |
} | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
HI