Write a C program to find the factorial of given number?
#include<stdio.h>
void main()
{
int i,f=1,num;
clrscr ();
printf("Enter a number: ");
scanf("%d",&num);
for(i=1;i<=num;i++)
f=f*i;
printf("Factorial of %d is: %d",num,f);
getch ();
}
Tags: factorial of given number,c programming,c
No comments:
Post a Comment