n = 3
DIM a(n, n)
FOR i = 1 TO n
FOR j = 1 TO n
INPUT "element", a(i, j)
NEXT
NEXT
FOR i = 1 TO n
SWAP a(i, i), a(i, n + 1 - i)
NEXT
FOR i = 1 TO n
FOR j = 1 TO n
PRINT " "; a(i, j)
NEXT
NEXT
Тестирование выполнено в программе QB64 ( Скачать )