JAVA
java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import java.util.*;
public class Program
{
public static void main(String[] args) {
Scanner input= new Scanner(System.in) ;
System.out.println("Enter Row Number: ");
int n = input.nextInt();
for(int row=1; row<=n; row++){
// Space printing
for(int col=2*(n-row); col>=1; col--){
System.out.print(" ");
}
// Number Printing
for(int col=1; col<=row; col++){
System.out.print("*");
}
//Printing New Line
System.out.println(" ");
}
}
}
Enter to Rename, Shift+Enter to Preview
OUTPUT
Run