What's wrong with this code? getting wrong answer while submitting plz smone hlp

#include<stdio.h>

int main(void) {
// your code goes here
int T,i;
scanf("%d",&T);
for(i=1;i<=T;i++){
int a,fact=1;
scanf("%d",&a);

       while(a>1){
         
       fact=fact*a;
       a=a-1;
       }
     
     printf("%d\n",fact);     
}
return 0;

}

Since you have used int data type for fact, answer might have been overflowed, better try by declaring fact as long long.

tried that but its still saying wrong answer

Can you please share question link?

https://www.codechef.com/problems/FCTRL2

Even long long int data type cant store the value of fact(100)=933262154439441526816992388562667004-
907159682643816214685929638952175999-
932299156089414639761565182862536979-
208272237582511852109168640000000000-
00000000000000, better try this `

How to compute factorial of 100 using a C/C++ program?

Factorial of a large number - GeeksforGeeks

Use Big int available in java and python to compute factorial

def fact(n):
if(n==0 or n==1):
return 1
else:
return n*fact(n-1)
q=int(input())
for _ in range(q):
n=int(input())
print(fact(n))

`

You Can Checkout My Answer Try To Understand The Concept And Write It In C++
Or Check Out Is Editorial
My Answer Link: Solution: 44354001 | CodeChef

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.math.BigInteger;

/* Name of the class has to be "Main" only if the class is public. */
class Codechef
{
	public static void main (String[] args) throws java.lang.Exception
	{
		// your code goes here
        BufferedReader scin = new BufferedReader(new InputStreamReader(System.in));
        int t = Integer.parseInt(scin.readLine());
        while (t>0){
            int n;
            BigInteger bigInteger = new BigInteger("1");
            n = Integer.parseInt(scin.readLine());
            for (long i=2; i<=n; i++){
                bigInteger = bigInteger.multiply(BigInteger.valueOf(i));
            }
            System.out.println(bigInteger);
            t--;
        }
	}
}