Computer Science, asked by ApratimDutta, 2 months ago

wap in java to solve the following pattern
5 4 3 2 1
4 3 2 1
3 2 1
2 1
1 ​

Answers

Answered by manuprajapati519
1

Answer:

public class DownwardTrianglePattern

{

public static void main(String[] args)

{

int rows=7;

//inner loop

for (int i= rows-1; i>=0 ; i--)

{

//outer loop

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

{

//prints star and space

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

}

//throws the cursor in the next line after printing each line

System.out.println();

}

}

}

Explanation:

Hey Friend..I have made the program to print this upside down triangle in Java..I hope it will help you and also like the answer and mark my answer as Brainliest..

Similar questions