(b) Write a program to display the given pattern:
3
5 6
8 9 10
12 13 14 15
Answers
Answered by
5
Answer:
int n=3,k=2,c=0;
for(int i=1;i<=4;i++)
{
for(int j=n;j<=(n+c);j++)
{
System.out.print(j);
}
System.out.println();
n=n+k;
++k;
++c;
}
Similar questions