C
c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
// Created by Yogesh Rajput
#include<stdio.h>
int main() {
int i, j, rows;
int count = 1;
printf("Enter the number of rows\n");
scanf("%d", &rows);
for (i = 1; i <= rows; i++) {
for (j = 1; j <= i; j++) {
printf("%d ", count);
count = !count;
}
count = i % 2;
printf("\n");
}
return 0;
// this code has not run. please hhelp me to run it
}
Enter to Rename, Shift+Enter to Preview
OUTPUT
Run