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 e70e6be commit fedf0eeCopy full SHA for fedf0ee
Pattern-1/Interesting_Alphabets.java
@@ -0,0 +1,35 @@
1
+/*
2
+Print the following pattern for the given number of rows.
3
+Pattern for N = 5
4
+E
5
+DE
6
+CDE
7
+BCDE
8
+ABCDE
9
+*/
10
+
11
+import java.util.*;
12
13
+public class Interesting_Alphabets {
14
+ public static void main(String[] args) {
15
16
+ /*
17
+ * Your class should be named Solution.
18
+ * Read input as specified in the question.
19
+ * Print output as specified in the question.
20
+ */
21
+ Scanner sc = new Scanner(System.in);
22
+ int N = sc.nextInt();
23
+ int m;
24
+ char c = (char) (65 + N);
25
+ for (int i = 1; i <= N; i++) {
26
+ c = (char) (c - i);
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