Category: Recursion

16
May
2017

Fibonacci in C with Recursion

code from 1: #include<stdio.h> long getFibbTerm(int t) { if(t==1||t==2) return 1; return getFibbTerm(t-1)+getFibbTerm(t-2); } int main() {…

16
May
2017

Tower of Hanoi Recursion

code: #include<stdio.h> void toh(int n,int source,int aux,int dest) { if(n==1){ //just pick and place printf(“move the disk…

14
May
2017

Recursion in C

code: #include<stdio.h> void printNo(unsigned int n) { if(n==0) return; //it is outing from this function and going…