Write nested for loops to produce the following output:
*****
*****
*****
*****
Program:
public class Ch02Ex04
{
public static final int ROWS = 4;
public static final int COLS = 5;
public static void main(String[] args)
{
for(int r = 1; r <= ROWS; r++)
{
for(int c = 1; c <= COLS; c++)
{
System.out.print("*");
}
System.out.println();
}
}
}
Output:
*****
*****
*****
*****