EASY ENGINEERING BY NVSA SOLUTIONS :: NVSA
1234
Solution-21
public class Solution21 {
public static void main(String[] args) {
int k=1;
for(int i=1;i<=5;i++)
{
for(int j=1;j<=i;j++,k++)
{
System.out.print(k);
if(i!=j)
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