FACT

Document Sample
FACT Powered By Docstoc
					/* Write a program to find out the factorial of the number */
long fact(long int);
void main()
 {
    int no;
    long ans;
    clrscr();
    printf("Enter an Intger Number : ");
    scanf("%d",&no);
    ans = fact(no);
    printf("\nThe Factorial is : %ld",ans);
   getch();
}

long fact(long int n)
 {
   if(n==0)
    return 1;
   else
    n = n * fact(n-1);
   return n;
 }

				
DOCUMENT INFO
Shared By:
Categories:
Tags:
Stats:
views:14
posted:3/21/2010
language:English
pages:1
Description: gtu-mca.blogspot.com