Author Topic: Java Program to display abcd in a diamond shape pattern  (Read 3691 times)

kathir

  • Administrator
  • Sr. Member
  • *****
  • Posts: 283
Java Program to display abcd in a diamond shape pattern
« on: February 10, 2012, 06:28:15 pm »
Here is the Java Program to display abcd in a diamond shape pattern:

      A
    B C D
  E F G H I
J K L M N O P
  Q R S T U
    V W X
      Y



Code: (java)
//Source Code Listing

import java.lang.*;
import java.util.*;
import java.io.*;
 
 
class DisplayABC
{
      
      public static void main(String[] args)
      {
           System.out.println("Display ABC in diamond shape: ");
           int [] shape = new int [] { 1, 3, 5, 7, 5, 3, 1};
           int [] space = new int [] { 6, 4, 2, 0, 2, 4, 6};
           int count = 0;
           int rowindex = 0;
           for(int i = 0; i < 26; i++)
           {
                if(count == 0)
                {
                  int spacecount = space[rowindex];
                  for(int j = 0; j < spacecount; j++)
                     System.out.print(" ");
                }  
                System.out.format("%1$-2c", (char) (i + 'A') );
                count++;
                if(shape[rowindex] == count)
                {
                  System.out.println();
                  rowindex++;
                  count = 0;
                }
           }
      }
}


patriceis16

  • Group8
  • *
  • Posts: 1
    • Grown up site
Re: Java Program to display abcd in a diamond shape pattern
« Reply #1 on: March 06, 2017, 07:52:28 pm »
After my modish engagement
http://rivera.femdom.twiclub.in/?dispatch.elizabeth
 erotic comics pdf sex live erotic mp erotical nights erotic romances

ursulaal11

  • Group8
  • *
  • Posts: 1
    • Unshackle galleries
Re: Java Program to display abcd in a diamond shape pattern
« Reply #2 on: March 08, 2017, 03:53:37 am »
 Novel work
http://teen.polish.yopoint.in/?post.jaime
 emily osment porn fake porn hub sexy wife shower audition porn drunk abused porn free psp porn galleries 

brookeeg11

  • Group8
  • *
  • Posts: 1
    • Loose galleries
Re: Java Program to display abcd in a diamond shape pattern
« Reply #3 on: March 19, 2017, 11:19:28 am »
Check my altered engagement
http://pattaya.girls.blogporn.in/?post.jane
 komik performing teens lord athan

bertamq18

  • Group8
  • *
  • Posts: 1
    • Unencumbered galleries
Re: Java Program to display abcd in a diamond shape pattern
« Reply #4 on: March 21, 2017, 07:25:08 am »
 New adult blog website
   extreme penis sounding kids summer dresses stories hypnosis erotic 
http://sissytales.porndairy.in/?blog.ainsley
  how to hypnotist free dictionary download for laptop apartments for rent cape town fiction femdom tv seriex hbo bdsm and submission party dresses sale my fiance is gay 

maxinepw11

  • Group8
  • *
  • Posts: 1
Re: Java Program to display abcd in a diamond shape pattern
« Reply #5 on: March 22, 2017, 10:59:55 pm »
 Original work
http://onstrapon.purplesphere.in/?register.abigayle
 erotic fan fiction free adult games erotic texts erotic trailers erotic modeling

 


Disclaimer: This web site is for educational and informational purposes only. Click here to read the Disclaimer.
Content copyright 2010-2014. Kathiresan. All rights reserved.
This page is using SMF version 2.0.1