#include<stdio.h>
#include<conio.h>
void main()
{
int fac , n , i = 1;
clrscr();
printf("Enter the number");
scanf("%d",&n);
fac = 1;
for(i = 1; i< = n; i++)
{
fac = fac * i;
}
printf("\n factorial of %d is %d", n, fac);
getch();
}
#include<conio.h>
void main()
{
int fac , n , i = 1;
clrscr();
printf("Enter the number");
scanf("%d",&n);
fac = 1;
for(i = 1; i< = n; i++)
{
fac = fac * i;
}
printf("\n factorial of %d is %d", n, fac);
getch();
}
Dear Arpit,
ReplyDeleteNice to see your interest in C Programming Practicals. Do provide your feedback on my blog on C Program Practicals.