Star printing program in Java, pattern 8

 Star printing program in Java: pattern 8

Star printing program in Java
 Star printing program in Java





Code for this pattern:


public class star {

    public static void main(String[] args) {
        int i, j, k;
        for(i=1;i<=5;i++)
        {
            for(j=i;j<5;j++)
            {
                System.out.print(" ");
            }
            for(k=1;k<(i*2);k++)
            {
                System.out.print("*");
            }
            System.out.print("\n");
        }
        for(i=4;i>=1;i--)
        {
            for(j=5;j>i;j--)
            {
                System.out.print(" ");
            }
            for(k=1;k<(i*2);k++)
            {
                System.out.print("*");
            }
            System.out.print("\n");
        }


    }

}


Try this in C.

Related post :

How to print Stars pattern in C                                 How to print Stars pattern in Java

Previous pattern                                                                                                         

11/Post a Comment/Comments

  1. Really an interesting post om star printing in Java.Continue sharing more like this.
    Regards,
    JAVA Training in Chennai | JAVA course in Chennai

    ReplyDelete
  2. Day by day I am getting new things and learn new concept through your blogs, I feel very confident, thanks for your informative blog keep your post as updated one...
    Regards,
    JAVA Training in Chennai|J2EE Training in Chennai

    ReplyDelete
  3. Java is programming language which is used in almost all the applications and games which are on the web. Java is being used extensively and it will be used extensively in near future. So getting trained in Java will surely be helpful.
    Thanks,
    Java Training in Chennai | Java courses in Chennai | Java Training Institutes in Chennai

    ReplyDelete
  4. Thanks for taking time to share this webpage.It is really interesting to read.Continue shares more.
    Regards,
    C Training in Chennai | C++ training | C and C++ institute

    ReplyDelete
  5. In near future, big data handling and processing is going to the future of IT industry. Thus taking Hadoop Training in Chennai | Big Data Training in Chennai will prove beneficial for talented professionals.

    ReplyDelete
  6. Nowadays, most of the businesses rely on cloud based CRM tool to power their business process. They want to access the business from anywhere and anytime. In such scenarios, salesforce CRM will ensure massive advantage to the business owners.Cloud Computing Training in Chennai

    ReplyDelete
  7. Thank you for this valuable information. I have got some important suggestions from it.
    best erp software in chennai | leading erp solutions in chennai

    ReplyDelete
  8. Really Nice Blog. Thank you for Sharing. We are the best erp software providers in chennai. For more details call +91 9677025199 or email us on info@bravetechnologies.in
    ERP Providers Chennai | ERP in Chennai

    ReplyDelete
  9. The best thing is that your blog really informative thanks for your great information!
    erp in chennai

    ReplyDelete
  10. Really nice post on Star printing program in Java.
    Java Training in Noida

    ReplyDelete

Post a Comment