I am supposed to give this output
* * * * *
* * * * *
* * * * * *
* * * * *
so on and so forth 5 itirations but it only shows the first 2 output
here's my code
public class itiration {
public static void main( String args[]){
int counter1 = 1;
int counter2 = 1;
int counter3 = 1;
while(counter1<=5)
{
while(counter2<=5)
{
System.out.print("* ");
System.out.print(" ");
counter2++;
}
System.out.println();
while(counter3<=5)
{
System.out.print(" ");
System.out.print("* ");
counter3++;
}
System.out.println();
counter1++;
}
}
}
this is not a homework