biityy34 16 Newbie Poster
public class Output2 {

    public static void main(String[] args) {
        int n = 10;
          for(int i=0;i<n;i++)
          {
              for(int j=0;j<n;j++)
              {

                  if(i == j || n - j == i + 1 )

//                        
//              
                  {
                  System.out.print("* ");
                  }
                  else if
                  (i == n/2 - 1 || j == n/2 -1 || i == n/2 ||j == n/2)
                  System.out.print("* ");
                  else
                      System.out.print(" ");

                  if
                  (i == 0 || j == 0 || i == n- 1 || j == n -1)
                  System.out.print("  ");
                  else 
                      System.out.print(" ");
                          }
                  System.out.println();
              }
      }

      }

//this is expected output[Click Here

arrow_square.png

](null)

rproffitt commented: What is i, j, n? Always use descriptive variable names. +16