Pattern -1
*****
*****
*****
*****
Solution:
- In this pattern, there are 4 rows and 5 columns
- It's a normal square pattern that prints * in the inner(column) loop
public class squarePattern {
public static void main(String[] args) {
// size of the square
int size = 4;
// outer loop
for (int i = 0; i < size; i++) {
// inner loop
for (int j = 0; j < size; j++) {
System.out.print("*");
}
System.out.println();
}
}
}