Program Code:
#include<stdio.h>
int main()
{
int fact =1 ,n , i ,j;
printf("Enter Range A : ");
scanf("%d",&n);
printf("\n\n");
printf("A\t\tFactorial A\n\n");
for(i =1;i<n;i++)
{
for(j=1;j<=i;j++)
{
fact = fact * j;
}
printf("%d",i,"\t\t",fact);
printf("\n");
fact = 1;
}
return 0;
}
Output:
.exe file |
No comments:
Post a Comment