Please suggest me a more efficient alternative to go about this Program
#include <stdio.h>
int main(void)
{
int k, i, t;
int arr[100]; //Declaring an array
printf("Enter a positive integer: ");
scanf("%d", &k);
for (i = 0; i < k; i++)
{
//printf("enter a value %d : ", i);
scanf("%d", &arr[i]);
}
for (i = 0; i < k; i++)
{
fact(arr[i]);
}
}
int fact(int num) // defining function fact(Num)
{
int i;
int fact1 = 1;
for (i = 1; i <= num; i++)
{
fact1 = fact1 * i;
}
printf("%ld\n", fact1);
}