Tag: 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() {…

14
May
2017

When We Need Recursion ?

When we don’t need any explicit stacks then we need recursion: #include<stdio.h> void decToBin(unsigned int n){ if(n==1)…

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…

13
May
2017

Recursion Example

code: #include<stdio.h> void printMsg(unsigned int n) { if(n==0) return; //when we are using return in void function…