helllo
last day i did program related to recursion that is factorial of numbers i red lot of books in my library but i found only this program only in every book.
i also thought lot on recursion but i did not find any more program please can anybody tell me or can give any clue to do more programs by using this concept.
i do not want program coding i just want question on it or any clue
please help me.

tower of hanoi is a very good example for solving by recusrion.

Though recusrion is helpful at times while solving some very critical problems though it has some demerits. Read about recursion in more detail to know its merit and demerits.

Member Avatar for fatihpiristine

solving factorial using recursion is not a good way as long as you can solve it with linear loop. keep it mind. you may get stack overflow.

find the book "The C Programming Language" from Dennis Ritchie and read it.

helllo
last day i did program related to recursion that is factorial of numbers i red lot of books in my library but i found only this program only in every book.
i also thought lot on recursion but i did not find any more program please can anybody tell me or can give any clue to do more programs by using this concept.
i do not want program coding i just want question on it or any clue
please help me.

#include<stdio.h>
#include<conio.h>
void fact(int);
void main()
{
int n;
printf("Enter the number:");
scanf("%d",&n);
fact(n);
getch();
}
void fact(int n)
{
int f=1,i;
f=f*1;
i=n;
for(;i>0;i--)
fact(i);
printf("Factorial is %d",f);
}

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.