Because you tried to code i will give you the answer for a,b.

Code:
#include <stdio.h>

int main(){
    for (int i=0;i<4;i++){
        printf("\n");
        for (int j=0;j<(i+1);j++)
            printf("%d",(i+j+1)%2);
    }
getchar();
int count=0;
    for (int i=0;i<4;i++){
        printf("\n");
        for (int j=0;j<(i+1);j++)
            printf("%d",count++);
    }
getchar();
    return 0;
}