C programming small factorial

#include<stdio.h>
float factorial(int n)
{
if(n==0 || n==1)
return 1;
else
return ( n*factorial(n-1));
}
int main()
{
int t,num,fact;
scanf("%d",&t);
while(t–)
{

    scanf("%d",&num);
        fact=factorial(num);
        printf("%d\n",fact);
   
}
return 0;

}
What is wrong in this why it is not acceptable??

thats because of the datatype which is int and its overflowing…

#include <bits/stdc++.h>
#include <boost/multiprecision/cpp_int.hpp>
using namespace boost::multiprecision;
using namespace std;
#define ll long long int
int main() {
// your code goes here
int t;
cin>>t;
while(t–)
{
unsigned long long n;
cpp_int fact=1;
cin>>n;
for(ll i=1;i<=n;i++)
{
fact*=i;
}
cout<<fact<<"\n";

}
return 0;

}

use this code cpp_int can store 128bits