//Code:
#include
#include
void main()
{
int i,j,fact=1;
clrscr();
printf("\n Enter the value of i = ");
scanf("%d",&i);
for(j=1;j<=i;j++)
fact=fact*j;
printf("\n The factorial of the given no is = %d",fact);
getch();
}
/*Output:
Enter the value of i = 5
The factorial of the given no is = 120
No comments:
Post a Comment