#include <stdio.h>
#include <stdlib.h>

void binarySequence(int b, int a[], int N)
{
    if(b>=N)
        //this condition makes sure that the strings will print the proper number of strings assigned to it after the if function, therefore the if loop won't be executed until it has assigned a value of N to b
    {
        int i;
        //declare i as int typed variable
        for(i=0; i<N; ++i)
        {
            printf("\t%d", a[i]);
            //prints the value of the array at the number assigned to it after the if loop in this function
        }
        printf("\n");
        return;
    }
    a[b]=0;
    binarySequence(b+1, a, N);
    a[b]=1;
    binarySequence(b+1, a, N);
    //these four lines assure that 0s and 1s are repeated in the strings
}

int main()
{
    int N;
    printf("Please enter a positive integer\n");
    scanf("%d", &N);
    //read how many columns of strings user wants

    int *a=(int*)malloc(N*sizeof(int));
    //request memory for N integers
    binarySequence(0, a, N);
    //execute function binarySequence with inputs 0, a, N


    return 0;
}
