#include<stdio.h>
#include<conio.h>
long Fact (int n)
long Fact (int n)
{
if (n==0)
if (n==0)
return 1;
return (long)n*Fact(n-1);
return (long)n*Fact(n-1);
}
void main()
void main()
{
int n;
clrscr ():
printf("Enter any positive integer: ");
scanf ("%d", &n);
printf("%d!= %ld",n,Fact(n));
int n;
clrscr ():
printf("Enter any positive integer: ");
scanf ("%d", &n);
printf("%d!= %ld",n,Fact(n));
getch ();
}
No comments:
Post a Comment