0% found this document useful (0 votes)
9 views1 page

Program to Print Pattern

Uploaded by

eascseblr
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views1 page

Program to Print Pattern

Uploaded by

eascseblr
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

Program to print

2
24
246
2468

public class PatternPrinter {

public static void printPattern() {

for (int i = 1; i <= 4; i++) { // ?1?: i = 1, ?2?: i <= 4, ?3?: i++


for (int j = 1; j <= i; j++) { // ?4?: j <= i
System.out.print(2 * j + " ");
}
System.out.println();
}
}

public static void main(String[] args) {


printPattern();
}
}

You might also like