Question: public static char [ ] [ ] getTriangles ( int rows ) { char [ ] [ ] triangle = new char [ rows ]
public static char getTrianglesint rows
char triangle new charrowsrows ;
for int i ; i rows; i
for int j ; j rows ; j
if j rows i j rows i
triangleij;
else if j rows i && j rows i
triangleij;
else
triangleij;
return triangle;
This doesnt make the correct pattern. The correct pattern is provided in the image. Triangle Pattern
A Triangle pattern with row contains lines with characters on each line. The first line contains a
space followed by a forward slash, a backslash, and a space. The second line contains a forward
slash followed by underscores followed by a backslash. For example,
A Triangle pattern with rows is made up of lines with characters on each line and is formatted
as shown below. The first line contains spaces, followed by a forward slash, backslash, and
spaces. The second line contains a space, followed by a forward slash, underscores, a backslash,
and a space. The third line contains a forward slash followed by underscores and a backslash.
A Triangle pattern with rows is made up of lines with characters on each line and is formatted
as shown below.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
