this will give you the opposite from what you want in 1)
do the rest by yourself
(hint:you must add 1 char and 1 number in order to work as you want...but where?)
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)%2);
}
getchar();
return 0;
}
output
---------
0
10
010
1010
with this try and 2)