Horje
Pyramid pattern program in java Code Example
Pyramid pattern program in java
// pyramid pattern - TutorialsTonight

public class pyramid {
  // pyramid star pattern
  public static void main(String[] args) {

    int size = 5;
    for (int i = 0; i < size; i++) {
      // print spaces
      for (int j = 0; j < size - i - 1; j++) {
        System.out.print(" ");
      }
      // print stars
      for (int k = 0; k < 2 * i + 1; k++) {
        System.out.print("*");
      }
      System.out.println();
    }
  }
}
/* Output:
    *
   ***
  *****
 *******
*********

*/




Java

Related
c# or java Code Example c# or java Code Example
room insert and return id Code Example room insert and return id Code Example
array minimum element Code Example array minimum element Code Example
intelilj javadoc: error - Malformed locale name: UTF8 Code Example intelilj javadoc: error - Malformed locale name: UTF8 Code Example
android studio setMargin Code Example android studio setMargin Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
14