-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPatternsPart1.java
More file actions
39 lines (36 loc) · 1.36 KB
/
PatternsPart1.java
File metadata and controls
39 lines (36 loc) · 1.36 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
public class PatternsPart1 {
public static void main(String[] args) {
for(int line = 1; line <= 4; line++) { // Pattern
for(int stars = 1; stars <= line; stars++){
System.out.print("*");
}
System.out.println();
}
// int n =4; // Inverted Star Pattern
// for(int line = 1; line<=n; line++) {
// for(int stars =1; stars <=n-line+1; stars++){
// System.out.print("*");
// }
// System.out.println();
// }
// int n= 4; // Half Parimid
// for(int line = 1; line <= n; line++) {
// //numbers
// for(int number = 1; number <= line ; number++) {
// System.out.print(number);
// }
// System.out.println();
// }
// int n =4; // Character Pattern
// char ch = 'A';
// //Outer Loop
// for(int line = 1; line <= n ; line++){
// //Inner Loop
// for(int chars = 1 ; chars <= line ; chars++) {
// System.out.print(ch);
// ch++;
// }
// System.out.println();
// }
}
}