EASY ENGINEERING BY NVSA SOLUTIONS :: NVSA
1234
Solution-7
public class Star3 {
public static void main(String[] args) {
for(int i=1;i<=5;i++)
{
for(int j=5;j>=i;j--)
{
System.out.print(" ");
}
for(int k=1;k<=i;k++)
{
if(k>=1&&i<=k-1)
{
System.out.print("");
}
}
System.out.println("*");
}
}
}
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment