- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPattern1.java
More file actions
Latest commit
26 lines (23 loc) · 546 Bytes
/
Copy pathPattern1.java
File metadata and controls
26 lines (23 loc) · 546 Bytes
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
/**
*
* @author Mudassar
*/
importjava.util.Scanner;
publicclassPatter1 {
publicstaticvoidmain(String[] args) {
Scannersc=newScanner(System.in);
intn;
System.out.println("Number of rows you want");
n=sc.nextInt();
for(intj=1;j<=n;j++) {
for(intk=(n-j);k>0;k--)
{
System.out.print(" ");
}
for (inti = 0; i<j; i++) {
System.out.print("* ");
}
System.out.println();
}
}
}