I know this is easy to most of you. Even though I will be look stupid if
I will ask help about this simple problem. I'm not fun of using for loop
in my programs, I really don't know how to do it.
Output:
*****
*****
*****
*****
*****public class Ex1 { public static void main (String args[]) { int x = 0; int y = 0; for(y=0;y<5;y++) { for(x=0;x<4;x++) { System.out.print("*"); } System.out.println("*"); }
Output:
*
**
***
****
*****public class Ex2 { public static void main (String args[]) { for(int y=0;y<5;y++) { for(int x=0;x<y;x++) { System.out.print("*"); } System.out.println("*"); } } }
I made those simple codes on the upper. Now my problem is how can I make
an output like this, using for loop not just by simple System.out.print();
PS: The Periods/dots aren't included in output, I just can't move the............*
..........**
........***
......****
....*****
asterisk in those positions.