Relative Content

Tag Archive for recursion

Trouble understanding simple recursion in c [duplicate]

This question already has answers here: In plain English, what is recursion? (18 answers) Closed 9 years ago. My function: int num(int x) { if(x>0) num(x-1); else return 0; printf(“%d”,x); } This function takes a input x and prints the numbers from 1 upto x.I can’t seem to understand how this works, can someone please […]