525 views

2 Answers

Best answer
5 votes
5 votes

This will print Binary equivalent of number n. It will keep dividing by two, the number until it will reach to 1 or 0. Then it start printing in reverse.

The reverse order comes from the fact that its a head Recursion (A recursion is called head recursion when function get called before print statement).

For example if we call this f(10) then it will print 1010

selected by

Related questions

4 votes
4 votes
1 answer
1
ritwik_07 asked Jun 10, 2023
463 views
#include<stdio.h #include<string.h #define MAX(x, y) ((x) (y) ? (x) : (y)) int main() { int i = 10, j = 5, k = 0; k = MAX(i++, ++j); printf("%d %d %d", i, j, k); return ...
0 votes
0 votes
1 answer
2
0 votes
0 votes
1 answer
3
Anirudh Kaushal asked Apr 4, 2022
279 views
#include<stdio.h int main() { char num = '\011'; printf("%d",num); return 0; }
2 votes
2 votes
0 answers
4