Language: Java

#include <stdio.h>
#include <stdlib.h>
#define sqr(x) ((x)*(x))

int main(void) {
	int n,x,y,i,j;
	int **magic;

	while (1) {
		scanf("%d",&n);
		if (n==0) break;
		magic = (int **)calloc(n,sizeof(int *));
		for (i=0;i<n;i++) magic[i] = (int *)calloc(n,sizeof(int));
		x = n/2;
		y = n/2+1;
		for (i=1;i<=sqr(n);i++) {
			if (magic[y][x]==0) magic[y][x] = i;
			else {
				while (magic[y][x]>0) {
					x = (x+n-1)%n;
					y = (y+1)%n;
				}
				magic[y][x] = i;
			}
			x = (x+1)%n;
			y = (y+1)%n;
		}
		for (i=0;i<n;i++) {
			for (j=0;j<n;j++) printf("%4d",magic[i][j]);
			putchar('\n');
			free(magic[i]);
		}
		free(magic);
	}

	return 0;
}

Compiler output:
Main.java:1: error: illegal character: '#'
#include <stdio.h>
^
Main.java:1: error: class, interface, enum, or record expected
#include <stdio.h>
         ^
Main.java:2: error: illegal character: '#'
#include <stdlib.h>
^
Main.java:3: error: illegal character: '#'
#define sqr(x) ((x)*(x))
^
Main.java:7: error: class, interface, enum, or record expected
	int **magic;
	^
Main.java:9: error: class, interface, enum, or record expected
	while (1) {
	^
Main.java:11: error: class, interface, enum, or record expected
		if (n==0) break;
		^
Main.java:12: error: class, interface, enum, or record expected
		magic = (int **)calloc(n,sizeof(int *));
		^
Main.java:13: error: class, interface, enum, or record expected
		for (i=0;i<n;i++) magic[i] = (int *)calloc(n,sizeof(int));
		^
Main.java:13: error: class, interface, enum, or record expected
		for (i=0;i<n;i++) magic[i] = (int *)calloc(n,sizeof(int));
		         ^
Main.java:13: error: class, interface, enum, or record expected
		for (i=0;i<n;i++) magic[i] = (int *)calloc(n,sizeof(int));
		             ^
Main.java:14: error: class, interface, enum, or record expected
		x = n/2;
		^
Main.java:15: error: class, interface, enum, or record expected
		y = n/2+1;
		^
Main.java:16: error: class, interface, enum, or record expected
		for (i=1;i<=sqr(n);i++) {
		^
Main.java:16: error: class, interface, enum, or record expected
		for (i=1;i<=sqr(n);i++) {
		         ^
Main.java:16: error: class, interface, enum, or record expected
		for (i=1;i<=sqr(n);i++) {
		                   ^
Main.java:18: error: class, interface, enum, or record expected
			else {
			^
Main.java:21: error: class, interface, enum, or record expected
					y = (y+1)%n;
					^
Main.java:22: error: class, interface, enum, or record expected
				}
				^
Main.java:24: error: class, interface, enum, or record expected
			}
			^
Main.java:26: error: class, interface, enum, or record expected
			y = (y+1)%n;
			^
Main.java:27: error: class, interface, enum, or record expected
		}
		^
Main.java:28: error: class, interface, enum, or record expected
		for (i=0;i<n;i++) {
		         ^
Main.java:28: error: class, interface, enum, or record expected
		for (i=0;i<n;i++) {
		             ^
Main.java:29: error: class, interface, enum, or record expected
			for (j=0;j<n;j++) printf("%4d",magic[i][j]);
			         ^
Main.java:29: error: class, interface, enum, or record expected
			for (j=0;j<n;j++) printf("%4d",magic[i][j]);
			             ^
Main.java:30: error: class, interface, enum, or record expected
			putchar('\n');
			^
Main.java:31: error: class, interface, enum, or record expected
			free(magic[i]);
			^
Main.java:32: error: class, interface, enum, or record expected
		}
		^
Main.java:34: error: class, interface, enum, or record expected
	}
	^
Main.java:37: error: class, interface, enum, or record expected
}
^
31 errors