You are not logged in. Please login at www.codechef.com to post your questions!

×

This code is working well in my IDE. Why this is showing wrong answer on codechef for problem FCTRL2?

include<stdio.h>

int main() { int t,n, arr[100], fact=1,k; scanf("%d", &t); for(n=0; n<t; n++) { scanf("%d", &arr[n]); }

for(n=0; n<t; n++) { for(k=1; k<=arr[n]; k++) { fact=fact*k;

  }
 printf("%d\n", fact);

fact=1;
}

}

asked 13 Sep, 20:33

shubhamprateek's gravatar image

0★shubhamprateek
1
accept rate: 0%

toggle preview
Preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • 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:

×1,461

question asked: 13 Sep, 20:33

question was seen: 42 times

last updated: 13 Sep, 20:33