Tag: 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() {…
When we don’t need any explicit stacks then we need recursion: #include<stdio.h> void decToBin(unsigned int n){ if(n==1)…
code: #include<stdio.h> void printNo(unsigned int n) { if(n==0) return; //it is outing from this function and going…
code: #include<stdio.h> void printMsg(unsigned int n) { if(n==0) return; //when we are using return in void function…
Recent Comments