can anyone answer this question plz..............
Attachments:
Answers
Answered by
0
import java.util.Scanner;
public class TrianglePattern {
public static void main(String[ ] args) {
// Accepting height of the triangle.
Scanner sc = new Scanner(System.in);
System.out.println("Enter the height of the triangle - ");
int rows = sc.nextInt( );
// Printing the triangle pattern.
for (int i = 1; i <= rows; i++) {
for (int j = rows; j >= i; j- -)
System.out.print(" ");
for (int j = 1; j <= i; j++)
System.out.print((j = = 1 || j = = i || i = = rows) ? "* " : "+ ");
System.out.println( );
}
}
}
Answered by
0
Answer:
jsjsjkskaoqpwllwknsbshsio
Similar questions