File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ package javapatternsmorning ;
2+
3+ /**
4+ *
5+ * @author ErSKS
6+ */
7+ public class Pattern13 {
8+
9+ public static void p () {
10+ System .out .println ("\n Pattern13" );
11+ int a = 1 ;
12+ int n = 10 ;
13+ for (int i = 1 ; i <= n ; i ++) {
14+ for (int j = 0 ; j < i ; j ++) {
15+ if ((i + j ) % 2 == 0 ) {
16+ System .out .printf ("0" );
17+ } else {
18+ System .out .printf ("1" );
19+ }
20+ }
21+ System .out .println ("" );
22+ }
23+ }
24+ }
Original file line number Diff line number Diff line change 1+ package javapatternsmorning ;
2+
3+ /**
4+ *
5+ * @author ErSKS
6+ */
7+ public class Pattern14 {
8+
9+ public static void p () {
10+ System .out .println ("\n Pattern14" );
11+ int a = 1 ;
12+ int n = 9 ;
13+ for (int i = 1 ; i <= n ; i ++) {
14+ for (int j = 0 ; j < i ; j ++) {
15+ System .out .print (a - 1 );
16+ }
17+ a ++;
18+ System .out .println ("" );
19+ }
20+ }
21+ }
You can’t perform that action at this time.
0 commit comments