Mirrored Right Triangle Star Pattern in Java

Mirrored right triangle star pattern in java. 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.

Right Triangle Definition

A right triangle, sometimes known as a right-angled triangle, or more technically an orthogonal triangle, is a triangle with one right angle. Trigonometry is founded on the relationship between the sides and other angles of a right triangle. The hypotenuse is the side opposite the right angle.

A right triangle is a triangle in which one of the inner angles is 90°. The hypotenuse is the longest side of the right triangle, as well as the side opposite the right angle, and the two arms of the right angle are the height and the base.

For Loop Definition in Java

The “for” loop in Java is an entry-controlled loop that allows a user to iteratively execute a block of statement(s) for a fixed number of times. The number of iterations is determined by the test condition specified within the “for” loop. The Java “for” loop is one of the simplest Java loops to grasp. A “For” Loop is used to iterate over a specific block of code a predetermined number of times.

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:

* * * * *

* * * *

* * *

* *

*