A C program to find factorial of a number.

// A C program to find factorial of a number

#include<stdio.h>
#include<conio.h>
void main()
{
clrscr();
int n,fact=1,i=1;
printf("Enter an integer number: ");
scanf("%d",&n);
for(i=n;i>=1;i--)
{
fact=fact*i;
}
printf("\nFactorial of %d is = %d",n,fact);
getch();
}


Output:

A C program to find factorial of a number., write a A C program to find factorial of a number, my knowledge to you dude











Post a Comment

0 Comments