Home >>Java Programs >Java Program to Print the following Pattern
In this example, we will see a Java program in which we will print the above-given pattern on the console.
Algorithm:
class Main
{
public static void main(String[] args)
{
int i ,j;
int n = 6;
for(i = n; i>0 ; i-- )
{
for(j = 0; j<i ; j++)
{
System.out.print("*");
}
System.out.println("");
}
}
}