Number Patterns

Print the bellow pattern:-

1

2 3

4 5 6

7 8 9 10

11 12 13 14 15

__________________________

public class NumberPatter1

{

public static void main()

{

int k=1;

for(int i=0; i<=5;i++)

{

for(int j=0;j<i;j++)

{

System.out.print(k+" ");

k++;

}

System.out.println();

}

}

}