amar singh 0 Newbie Poster
#include<stdio.h>
#include<conio.h>
main()
{
 int a,i,fact=1;
clrscr();
printf("Enter a number ");
scanf("%d",&a);
for(i=1;i<=a;i++)
{
 fact=fact*i;
}
printf("Fact of %d is %d",fact,a);
getch();
}
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.