Skip to main content

Triangle Pattern in java

Triangle Pattern in java

triangle

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
package logic;
 
public class pattrnprog 
{
 
	public static void main(String[] args)
 
	{
 
		for(int i=0;i<=4;i++)
		{
			for(int j=i;j<=4;j++)
			{
				System.out.print(" ");
 
			}
 
			for(int k=0;k<(2*i)+1;k++)
			{
				System.out.print("*");
			}
 
			System.out.println();
 
 
		}
	}
}