We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1f3dc3a commit 07031d4Copy full SHA for 07031d4
Pattern-1/Alpha_Pattern.java
@@ -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