Java Program - Pattern 3

        *
      * *
    * * *
  * * * *
* * * * *


The following is the code.

package com;

public class JavaProgram
{
public static void main(String args[])
   {
       int i, j, k=8;
       for(i=0; i<5; i++)
       {
           for(j=0; j<k; j++)
           {
               System.out.print(" ");
           }
           k = k - 2;
           for(j=0; j<=i; j++)
           {
               System.out.print("* ");
           }
           System.out.println();
       }
   }
}

No comments:

Post a Comment

What is Normalization?

Database normalization is a data design and organization process applied to data structures based on rules that help building relational dat...