Automation Using Selenium Webdriver

Tuesday 28 February 2017

PrintDaimond program in java

package com.java.exp;

public class Diamond {
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.println();
}
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.println();
}
}


}

OUTPUT::


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

4 comments:

  1. Well done! Pleasant post! This truly helps me to discover the solutions for my inquiry. Trusting, that you will keep posting articles having heaps of valuable data. You're the best! 

    Selenium Training in Electronic City

    ReplyDelete
  2. This comment has been removed by the author.

    ReplyDelete
  3. Awesome blog. I enjoyed reading your articles. This is truly a great read for me. I have bookmarked it and I am looking forward to reading new articles. Keep up the good work!
    Wow, what great information on World Day, your exceptionally nice educational article. a debt of gratitude is owed for the position.
    Such a very useful blog. Very interesting to read this blog. I would like to thank you for the efforts you had made for writing this awesome blog.

    Microsoft Azure Course in Electronic City Bangalore
    Best AWS Training Institute in Electronic City Bangalore
    DevOps Certification course in Electronic City Bangalore

    ReplyDelete