Sum of digits in factorial of a number
Submissions: 265   Accuracy:

21.98%

  Difficulty: Easy   Marks: 2

Given a number n, write code to find the sum of digits in the factorial of the number.

Input:
The first line of input contains an integer T denoting the number of test cases. Then T test cases follow. Each test case contains an integer n, the number.

Output:
Print the sum of digits in the factorial of the number.

Constraints:
1<=T<=1000
1<=n<=5000

Example:
Input:

2
10
100

Output:
27
648

** For More Input/Output Examples Use 'Expected Output' option **

Contributor: Ayush Govil
Author: Ayush Govil 1


If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.



Need help with your code? Please use ide.geeksforgeeks.org, generate link and share the link here.


to report an issue on this page.