Thursday, October 1, 2015

Letters Patterns in Java

A simple program that I wrote that will create a letter patterns in Java using for loop statements.

If you  have some questions please send me an email at jake.r.pomperada@gmail.com and jakerpomperada@yahoo.com. My mobile number here in the Philippines is 09173084360.


Program Listing


// pattern10.java
// Written By: Mr. Jake R. Pomperada, BSCS, MAED-IT
// August 1, 2015   Saturday
// Create a Java Program to print the following shape
//  AAAAA
//  BBBBB
//  CCCCC
//  DDDDD
//  EEEEE

import java.lang.*;

public class pattern10 {

    public static void main(String[] args) {
           for (char i='A'; i<='E'; i++) {
            for (char j='A'; j<='E'; j++) {
              System.out.print(i);
            }
           System.out.println();
       }
       System.out.println();
      System.out.print("\t THANK YOU FOR USING THIS PROGRAM");
      System.out.println("\n\n");
   }
}

No comments:

Post a Comment