Skip to content

Commit 07031d4

Browse files
committed
Initial commit
1 parent 1f3dc3a commit 07031d4

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

Pattern-1/Alpha_Pattern.java

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
/*
2+
Print the following pattern for the given N number of rows.
3+
Pattern for N = 3
4+
A
5+
BB
6+
CCC
7+
*/
8+
9+
import java.util.*;
10+
11+
public class Alpha_Pattern {
12+
public static void main(String[] args) {
13+
14+
/*
15+
* Your class should be named Solution.
16+
* Read input as specified in the question.
17+
* Print output as specified in the question.
18+
*/
19+
Scanner sc = new Scanner(System.in);
20+
int N = sc.nextInt();
21+
char c = 65;
22+
for (int i = 1; i <= N; i++) {
23+
for (int j = 0; j < i; j++) {
24+
System.out.print(c);
25+
26+
}
27+
c++;
28+
System.out.println("");
29+
}
30+
31+
}
32+
}

0 commit comments

Comments
 (0)