import java.io.*;
import java.util.*;
public class sansvertical
{
public static void main(String args[])
{
int limit,i,j;
Scanner s=new Scanner(System.in);
System.out.print("enter the number of starts in the first line\t:");
limit=s.nextInt();
System.out.println();
for(i=limit;i>=1;i--)
{
for(int space=0;space<=(limit-i);space++)
{
System.out.print(" ");
}
for(j=1;j<=i;j++)
{
System.out.print("* ");
}
System.out.println();
}
for(i=2;i<=limit;i++)
{
for(int space=0;space<=(limit-i);space++)
{
System.out.print(" ");
}
for(j=1;j<=i;j++)
{
System.out.print("* ");
}
System.out.println();
}
}
}
OUTPUT
ask your questions as comments here!!!
import java.util.*;
public class sansvertical
{
public static void main(String args[])
{
int limit,i,j;
Scanner s=new Scanner(System.in);
System.out.print("enter the number of starts in the first line\t:");
limit=s.nextInt();
System.out.println();
for(i=limit;i>=1;i--)
{
for(int space=0;space<=(limit-i);space++)
{
System.out.print(" ");
}
for(j=1;j<=i;j++)
{
System.out.print("* ");
}
System.out.println();
}
for(i=2;i<=limit;i++)
{
for(int space=0;space<=(limit-i);space++)
{
System.out.print(" ");
}
for(j=1;j<=i;j++)
{
System.out.print("* ");
}
System.out.println();
}
}
}
OUTPUT
ask your questions as comments here!!!
*
ReplyDelete** **
*** ***
** **
*
How to Write this program to Print Star Pattern in Java
Really Nice Post to Print Star Pattern in Java Yesterday I visit this blog and i was found lots of helpful information from your side thanks for sharing updated and New Technology related Post.
Delete>>>>> Download Now
ReplyDelete>>>>> Download Full
>>>>> Download LINK
>>>>> Download Now
>>>>> Download Full
>>>>> Download LINK