#include<stdio.h>
#include<conio.h>
int fact(int);
main()
{
int n;
printf("enter value of fact to be find; \n");
scanf("%d",&n);
fact(n);
printf("%d factorial is %d",n,fact(n));
}
int fact(int m)
{
int f;
if(m==1)
return(1);
else
f=m*fact(m-1);
return(f);
}
#include<conio.h>
int fact(int);
main()
{
int n;
printf("enter value of fact to be find; \n");
scanf("%d",&n);
fact(n);
printf("%d factorial is %d",n,fact(n));
}
int fact(int m)
{
int f;
if(m==1)
return(1);
else
f=m*fact(m-1);
return(f);
}
No comments:
Post a Comment