JAVA
java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
/*This code is in response to d spiral numbers challenge. Enter a positive integer N and the code will generate a square grid of N*N numbers from 1 to N*N arranged n a spiral
PLEASE LEAVE A LIKE N COMMENT! */
import java.util.Scanner;
public class Program
{
static int numbers [][];
static int b=0;
static int c;
static int N;
static int rowId;
static int columnId;
static int row;
static int column;
static boolean columnConst;
static boolean rowConst;
static int rowmax;
static int rowmin;
static int colmax;
static int colmin;
public static void main(String[] args) {
begin();
}
public static void begin(){
Scanner input = new Scanner(System.in);
try{
N = input.nextInt();
input.close();
}
Enter to Rename, Shift+Enter to Preview
OUTPUT
Run