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 fedf0ee commit 1f3dc3aCopy full SHA for 1f3dc3a
Pattern-1/Character_Pattern.java
@@ -0,0 +1,35 @@
1
+/*
2
+Print the following pattern for the given N number of rows.
3
+Pattern for N = 4
4
+A
5
+BC
6
+CDE
7
+DEFG
8
+*/
9
+
10
+import java.util.*;
11
12
+public class Character_Pattern {
13
+ public static void main(String[] args) {
14
15
+ /*
16
+ * Your class should be named Solution.
17
+ * Read input as specified in the question.
18
+ * Print output as specified in the question.
19
+ */
20
+ Scanner sc = new Scanner(System.in);
21
+ int N = sc.nextInt();
22
+ int m;
23
+ char c;
24
+ for (int i = 1; i <= N; i++) {
25
+ m = 64 + i;
26
+ c = (char) m;
27
+ for (int j = 0; j < i; j++) {
28
+ System.out.print(c);
29
+ c++;
30
+ }
31
+ System.out.println("");
32
33
34
35
+}
0 commit comments