We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0fff0fb commit d09f77bCopy full SHA for d09f77b
1 file changed
PatternMaking
@@ -0,0 +1,34 @@
1
+/* For n =4 the output should be
2
+
3
+*
4
+* *
5
+* * *
6
+* * * *
7
8
9
10
11
+*/
12
13
+import java.util.Scanner;
14
15
+public class Solution {
16
17
+ public static void main(String[] args) {
18
+ Scanner s = new Scanner(System.in);
19
+ int n = s.nextInt();
20
+ for (int i = 1; i <= n; i++) {
21
+ for (int stars = 1; stars <= i; stars++) {
22
+ System.out.print("* ");
23
+ }
24
+ System.out.println();
25
26
+ for (int i = 1; i < n; i++) {
27
+ for (int stars = n - 1; stars >= i; stars--) {
28
29
30
31
32
33
34
+}
0 commit comments