EASY ENGINEERING BY NVSA SOLUTIONS :: NVSA
1234
Solution-6
public class Xpattern {
public static void main(String[] args) {
for(int i=0;i<=4;i++)
{
for(int j=0;j<=i;j++)
{
if(i>=1 && j<=i-1)
{
System.out.print(" ");
}
else
{
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