#include <stdio.h>
#include <unistd.h>

void func(int n)
{
    char c;
    c = n + '0';

    if(n>0)
    {
        write(1, &c, 1);
        func(n-1);
        func(n-1);
    }

}

int main() {
    func(3); 
   return 0;
}

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: