public void displayPyramid(int x, int y) { row = x; col = y; int r =0; int c =0; while(r<row)> { while(c<col)> { System.out.println("* "); c++; } System.out.println(); r++; } }
for (int i = 5; i > 0; i--) { int y = 5; y = y - i; for (int e = y; e > 0; e--) { Console.Write(" "); } for (int j = i; j > 0; j--) { Console.Write("* "); } Console.Write("\n"); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)