#include<stdio.h>
main()
{
int n,i=1,f=1;
printf("\nEnter a number=");
scanf("%d",&n);
while(i<=n)
{
f=f*i;
i++;
}
printf("\nfactorial of %d is %d",n,f);
}
main()
{
int n,i=1,f=1;
printf("\nEnter a number=");
scanf("%d",&n);
while(i<=n)
{
f=f*i;
i++;
}
printf("\nfactorial of %d is %d",n,f);
}
No comments:
Post a Comment