Wednesday, 28 November 2012

Determine Factorial value of a number using recursive function in C program

Write this program in Turbo C++ or Dev C++ and Run it.

int factorial(int x);
void main(){
       int n;
       printf("Enter Number:");
         printf("This is nagetive number!");
         printf("Factorial of %d is %d",n,factorial(n));
int factorial(int x){
    int fact=1;
 return (fact);   


Enter Number:6
Factorial of 6 is 720

No comments:

Post a Comment