Advertisement
finderabc

Stars_Х

Feb 2nd, 2019
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.35 KB | None | 0 0
  1. Scanner keyboard = new Scanner(System.in);
  2.         System.out.print("Enter Size: ");
  3.   int n = keyboard.nextInt();
  4.  
  5.   for (int i = 1; i <= n; i++) {
  6.   for (int j =1 ; j <= n; j++) {
  7.       if ((i == j) ||( i + j ==n + 1)) {
  8.           System.out.print("*");
  9.       } else {
  10.           System.out.print(" ");
  11.       }
  12.   }
  13.       System.out.println();
  14.   }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement