Program : Write a program to calculate factorial of given number
Created By : JABIR PATHAN
#include<stdio.h>
#include<conio.h>
long int fact(int);
void main()
{
int no;
clrscr();
printf("enter any number==>");
scanf("%d",&no);
printf("the factorial of entered number==>%d",fact(no));
getch();
}
long int fact(int num)
{
if(num==1)
return(1);
else
return(num*fact(num-1));
}
Created By : JABIR PATHAN
#include<stdio.h>
#include<conio.h>
long int fact(int);
void main()
{
int no;
clrscr();
printf("enter any number==>");
scanf("%d",&no);
printf("the factorial of entered number==>%d",fact(no));
getch();
}
long int fact(int num)
{
if(num==1)
return(1);
else
return(num*fact(num-1));
}