Anyone know how to display a triangle in the
1) Center and pointing up position
2) Center and pointing down position
for(int i = 0; i < 5; i++)
for (int j = 0; j < 5; j++)
I have tried for hours but have no idea how to do.
Take a piece of grid paper and draw in the figure you want.
Then for each row of the figure, do a println of a string with the *s spaced as per the drawing. For example for the point up, the first line would be a single centered *. As you move down there would be 2 *s with increasing spaces between then and decreasing spaces before and after them. The bottom line would be a row of *s all the way across.