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::
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::
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
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!
ReplyDeleteSelenium Training in Electronic City
This comment has been removed by the author.
ReplyDeleteThanks for the blog article.Much thanks again. Fantastic.
ReplyDeleteMulesoft training
python training
angular js training
selenium trainings
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!
ReplyDeleteWow, 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