forked from pikachu-17/java-projects
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPattern.java
More file actions
23 lines (23 loc) · 733 Bytes
/
Pattern.java
File metadata and controls
23 lines (23 loc) · 733 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
public class Pattern
{
public static void main(String[] args)
{
System.out.println("The star pattern is... ");
for (int m=1; m<=3; m++)
{
for (int p=1; p<=(m * 2) -1; p++)
{
System.out.print("*");
}
System.out.println();
}
for (int m=2; m>=1; m--)
{
for (int p=1; p<=(m * 2) -1; p++)
{
System.out.print("*");
}
System.out.println();
}
}
}