Advertisement
LegendSujay2019

Alphabet pyramid

Aug 24th, 2019
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.39 KB | None | 0 0
  1.  
  2. package javaapplication2;
  3. public class JavaApplication2 {
  4.      public static void main(String[] args) {
  5.         char last = 'E', alphabet = 'A';
  6.         for(int i = 1; i <= (last-'A'+1); ++i) {
  7.             for(int j = 1; j <= i; ++j) {
  8.                 System.out.print(alphabet + " ");
  9.             }
  10.             ++alphabet;
  11.             System.out.println();
  12.         }
  13.     }
  14.    
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement