79098888

Date: 2024-10-17 15:49:57
Score: 1
Natty:
Report link

enter image description here

public class SquarPattern {

public static void main(String[] args) {

    int n = 6;
    for (int i = 0; i < n; i++) {
        for (int j = 0; j < n; j++) {
            if((i==0 || i==n-1 )  || (j==0 || j==n-1)) {
              System.out.print("*");
            }else {
                  System.out.print(" ");
            }
        }
        System.out.println();
    }

}

}

Reasons:
  • Probably link only (1):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: Govind Sharma