CLS
n = 10
DIM a(n)
RANDOMIZE TIMER
FOR i = 1 TO n
a(i) = INT(RND * 100) - 50
NEXT i
PRINT "Ishodniy massiv"
FOR i = 1 TO n
PRINT a(i);
NEXT i
PRINT
min = a(1): imin = 1
FOR i = 2 TO n
IF a(i) < min THEN min = a(i): imin = i
NEXT i
SWAP a(imin), a(1)
PRINT "Massiv posle preobrazovaniy"
FOR i = 1 TO n
PRINT a(i);
NEXT i
END
Тестирование выполнено в программе QB64 ( Скачать )