What will be the output of the below function if n is positive ?
void myFun(unsigned int n) { if(n != 0) { myFun(n/2); printf("%d", n % 2); } }
The function prints the value of n in binary notation. For example: If n = 25 then the output will be 1 1 0 0 1.
Actually printing the remainders in reverse order (Head Recursion).
1 Comment
quite nice post, i certainly adore this web page, keep on it