HOME

Start

Control Statements

Array

Function

Structure

Pointer

File

Projects

 

 

 

 

 

 

C programing

Ckalari.com is the No.1 website to get the best of C programs, free source codes, projects in c language……  

Recurtion in c language

#include<stdio.h>

#include<conio.h>

int fact(int f);

void main()

     {

    int fa,num;

    clrscr();

    printf("\nEnter a number\n");

    scanf("%d",&num);

    fa=fact(num);

    printf("\n\nThe factorial of %d is::%d",num,fa);

    getch();

     }

int fact(int x)

     {

    int f;

    if(x==1)

    {

      return(1);

    }

    else

    {

      f=x*fact(x-1);

    }

    return(f);

     }

Copyright © 2007-2008 www.ckalari.com