Broken calculator(what is wrong !)

#include
using namespace std;
int main() {
unsigned long long int n,i=1,a=1;
cin>>n;
for(;i<=n;i=i+1){
a=a*i;
}
cout<<a;
return 0;
}

@Saksham12
Your code only works for small inputs till n<=20. Factorials grow extremely fast and go out of range of long long int even rather quickly.
If you try running your code for even input like n=21 or n=22 , you will see that it shows a negative answer due to overflow.
This is actually less of a problem to calculate factorial as that part is extremely easy and more of a problem to find a way to store it .
There is no data type in C++ to store such large numbers so you will need to figure out a way around this to store such large numbers and do the computations on it.
In this problem we can get an input as large as n=500 ( as specified in problem constraints ). 500! is over 1100 digits long.
Think of way to store such large values and try again.