Java program to print mirrored right triangle star pattern

Java program to print mirrored right triangle star pattern. In  java programming, the mirror side triangle pattern is used. In java pattern application, this program will print asterisk. In any programming language, this program is often called the reverse pattern program.

public class Main
{ 
public static void main(String args[]) 
{ 
int row=7,i,j,k;
for (i= row; i>= 1; i--) 
{ 
for(j=row; j>i;j--) 
{ 
System.out.print(" "); 
} 
for(k=1;k<=i;k++) 
{ 
System.out.print("*"); 
} 
System.out.println(""); 
} 
} 
} 

 

   Output:

   * * * * *

    * * * *

     * * *

       * *

        *