What is the C program to print the following triangle 1 10 101 1010?

for (int row=0; row<4; ++row) {

int i = 1;

for (int col=0; col<=row; ++col) {

printf ("%d", i);

i=(i==1?0:1);

}

}