CODE IS WORKING BUT STATUS IS COMING WORNG

small factorials
FCTRL2

#include <stdio.h>
int fact(int a);
int main(void) {
int t,n,j;
int f=1;
scanf("%d",&t);
while(t–){
scanf("%d",&n);
if(j=n){
f=1;
}
for(j=1;j<=n;j++){
f=f*j;

    }printf("%d\n",f);
    
} 
return 0;

}

2 Likes

sorry @ssjgz ,i am new here . Thankyou for suggestion.

1 Like