Skip to main content
To Get All Information of Sarkari Jobs | Results | Admit Card | And courses ,Internships then CLICK HERE

Recursion In Function-:

 

  • A function that called itself is known as recursive function and the process of calling function itself is known as Recursion.
  • The default data structure used in recursion is STACK.
  • Recursion works slower than loop.
  • Recursion is more alignment few variable,which make program clean.
  • It is hard to think a logic of recursive function it is also difficult to debug the code containing recursion.
techprogramiz
img credit:Google Images


Example-:

#include<stdio.h>
#include<conio.h>
main()
{int num=0 res=0;
printf("Enter the number");
scanf("%d".&num);
res=fact_N(num);
printf("\n Factorial of %d %d",num,res);
getch();
}
fact_N(intx)
{int f=0;
if(x==1)
return1;
else
f=x*fact_N(x-1);
returnf;
}



Comments

Post a Comment

Please do not enter any spam link in the comment box.


Download The Book "Let Us C" By Yashavant P.Kanetkar,Click The Below Button

-->Email Subscription

Enter Your Email Address:-

Delivered by FeedBurner

Copyright © 2020 TechProgramiz|All Right Reserved|Made By-: Sudarshan Pandey