Get the input from the user for the number of rows and columns.
Print 0 in the row one.
Print 1 in the row two.
Case= Test 1
input=
5
5
output=
00000
11111
00000
11111
00000
#include <stdio.h>
int main() {
int row, col;
int i, j;
scanf("%d", &row);
scanf("%d", &col);
for (i=0; i<row; i++) {
for (j=0; j<col; j++) {
printf("%d", i%2);
}
printf("\n");
}
return 0;
}
Comments
Leave a comment