Computer Science, asked by kavyasaxena106, 11 months ago

(b) Write a program to display the given pattern:
3
5 6
8 9 10
12 13 14 15

Answers

Answered by vicky8764
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
Math, 11 months ago