Computer Science, asked by irasangwan, 1 year ago

how to make a pattern like
1
2 3
4 5 6
7 8 9 10
11 12 13 14 15
using i and j loop?
plz answer fast...

Answers

Answered by akashnilroy
1
int i,j,k=1;
for(i=1;i<=5;i++)
{
for(j=1;j<=i;j++)
{
System.out.print(k + " ");
k ++;
}
System.out.println();
}

Similar questions