Computer Science, asked by kawaiirachel, 8 months ago

pls pls pls pls pls pls pls pls pls pls pls pls pls help me with this

write a program in java to print the pattern 1 2 3 4 5
6 7 8 9
10 11 12
13 14
​15​

Answers

Answered by ashishsingh419727
1

Explanation:

Here it is bro!

public class floyd_of_triangle

{

public static void main(String[] args) {

for(int x=1;x<=5;x++){

int a=0,b=4;

for(int y=1;y<=x; y++){

int s=x+a;

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

a=a+b;

b--;

}

System .out .println ();

}

}

Similar questions