Untitled

mail@pastecode.io avatar
unknown
plain_text
2 months ago
258 B
1
Indexable
Never
#include<stdio.h>
#include<conio.h>
int fact(int);
int main()
{
	int n;
	printf("enter a no");
	scanf("%d",&n);
	printf("factorial of no is:%d",fact(n));
	return 0;
}
int fact(int n)
{
	if(n==0||n==1)
	return 1;
	else
	return(n*fact(n-1));
}
Leave a Comment