Getting Wrong Answer, but input and output are correct (FCTRL2)

can someone explain how it detected wrong asnwer, even the input and output are correct

#include <stdio.h>

int main(){
	int t, n;
	scanf("%d", &t);
	int i, sum=1;
	if(t>=1 && t<=100){
		for(i=0;i<t;i++){
			scanf("%d", &n);
			if(n>=1 && n<=100){
				while(n>0){
					sum=sum*n;
					n--;
				}
				printf("%d\n", sum);
				sum=1;
			}
			else{
				return 0;
			}
		}
		return 0;
	}
	
	else{
		return 0;
	}
	
}

[quote=“mys73r10us, post:1, topic:93276”]

#include <stdio.h>

int main(){
	int t, n;
	scanf("%d", &t);
	int i, sum=1;
	if(t>=1 && t<=100){
		for(i=0;i<t;i++){
			scanf("%d", &n);
			if(n>=1 && n<=100){
				while(n>0){
					sum=sum*n;
					n--;
				}
				printf("%d\n", sum);
				sum=1;
			}
			else{
				return 0;
			}
		}
		return 0;
}
}

still get the wrong asnwer