#include<stdio.h>
#include<conio.h>
void main()
{
int a,f=1,i;
clrscr();
printf("Factorial i : ");
scanf("%d",&i);
for(a=1;a<=i;a++)
{
f=f*a;
}
printf("ANS %d = %d ",i,f);
getch();
}
Output:
Factorial i : 3
ANS 3 = 6
0 comments:
Post a Comment