Left triangle using star pattern program in java

Left triangle using star pattern program in java. This pattern print asterisk pattern in left side pascal pattern. Exactly pascal program is printed in left side facing in the output for beginners in java language

import java.util.Scanner; 
public class Main
{ 
public static void main(String[] args) 
{ 
int i, j, k, rows; 
Scanner sc = new Scanner(System.in); 
System.out.print("Enter the numbers"); 
rows = sc.nextInt(); 
for (i= 1; i<= rows ; i++) 
{ 
for (j=i; j <rows ;j++) 
{ 
System.out.print(" "); 
} 
for (k=1; k<=i;k++) 
{ 
System.out.print("*"); 
} 
System.out.println(""); 
} 
for (i=rows; i>=1; i--) 
{ 
for(j=i; j<=rows;j++) 
{ 
System.out.print(" "); 
} 
for(k=1; k<i ;k++) 
{ 
System.out.print("*"); 
} 
System.out.println(""); 
} 
} 
} 

 

Output:

enter the numbers5

        *

      **

    ***

  ****

*****

  ****

    ***

      **

        *