VILL- DEBANDI, AMTA, HOWRAH PIN-711410 Phone-9836357266
5.Input a number from user and then print the factorial of the number :—
#include<stdio.h>
int main()
{
int i,j,n;
printf("enter a number ");
scanf("%d",&n);
j=1;
for(i=1;i<=n;i++)
j=j*i;
}
printf("factorial of %d=%d\n",n,j);
return 0;
No comments:
Post a Comment