×

# include<stdio.h>

long long int fact(int n); int main() { int n,i,k[i]; long int d[i]; scanf("%d",&n); for(i=0;i<n;i++) {="" if(1<="n&lt;=100" &&="" 1<="k&lt;=100)" scanf("%d",&k[i]);="" }="" for(i="0;i&lt;n;i++)" {="" d[i]="fact(k[i]);" printf("%lld\\n",d[i]);="" }="" return="" 0;="" }="" long="" long="" int="" fact(int="" n)="" {="" if(n="">=1) return(n*fact(n-1)); else return 1; }

11
accept rate: 0%

 0 https://www.codechef.com/viewsolution/13353189 Check this. I hope you understand. answered 02 Sep '17, 17:46 16 accept rate: 10%
 0 If you want to solve it using recursion. Have a look at: https://www.codechef.com/viewsolution/15220161 answered 02 Sep '17, 17:49 16 accept rate: 10%
 toggle preview community wiki:
Preview

By Email:

Markdown Basics

• *italic* or _italic_
• **bold** or __bold__
• image?![alt text](/path/img.jpg "title")
• numbered list: 1. Foo 2. Bar
• to add a line break simply add two spaces to where you would like the new line to be.
• basic HTML tags are also supported
• mathemetical formulas in Latex between \$ symbol

Question tags:

×196
×33

question asked: 02 Sep '17, 17:34

question was seen: 183 times

last updated: 02 Sep '17, 17:49