99. JAVA Program to Print Number triangle.
How does this program work?
- This program is used to print Number Triangle using Java.
Here is the code
//To print Triangle Pattern
public class Pattern{
public static void main(String args[] )
{
int i,j,n=1;
for(i=5;i>=1;i--)
{
for (j=1;j< i;j++)
System.out.print(" ");
for(j=5;j>=i;j--)
System.out.print(+j);
System.out.print("\n" );
n++;
}
}
}