FCTRL2 - Small factorials


You are asked to calculate factorials of some small positive integers.

Input

An integer t, 1<=t<=100, denoting the number of testcases, followed by t lines, each containing a single integer n, 1<=n<=100.

Output

For each integer n given at input, display a line with the value of n!

Example

Sample input:
4
1
2
5
3

Sample output:

1
2
120
6

hide comments
anant6025: 2018-09-04 18:48:25

If you dont know the array approach then i'll prefer that you must first learn it from the geeksforgeeks tutorial as it'll be really helpful in the coming future as well.

dishant34: 2018-08-28 18:35:28

Max integer is 100 and its factorial has more than 150 digits, so use the array.

probeta: 2018-08-28 18:21:42

Python always comes to the rescue in case of very very large numbers !

n1trob4ct3r: 2018-08-22 19:11:19

easy. AC in one go.

yoinfinite_25: 2018-08-19 19:50:56

I keep getting 'wrong answer' in C. Tried calling a function after input of 'n' in a function. What am I doing wrong?

mushusax: 2018-08-17 23:58:03

Getting wrong answer on submit even though I'm getting correct answer. It's a problem with newline. How should output be structured? Should last number end in new line?

Solution: return the answers after ALL input is received.

Last edit: 2018-08-18 00:20:47
martinho_11235: 2018-08-09 13:12:54

Before submit you have to test with 100...

raj012: 2018-08-02 21:35:09

Use Java's BigInteger for calculation involving large number digits.

dexus: 2018-07-26 09:00:23

Can anyone please help me what mistake am I making ?
This is happening with me for almost all the solutions that I submit.
Link :<snip>

Last edit: 2022-09-17 23:08:17
itachi007: 2018-06-29 15:27:24

in c++ , use boost library, and dont forget to choose c++14(gcc6.3) compiler otherwise you will get compiler error


Added by:adrian
Date:2004-05-28
Time limit:1s
Source limit:2000B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Languages:All