' Zavodim tselochislennii massiv
DIM K(11) AS INTEGER
' Zapolnyaem yego
FOR i = 1 TO 11
K(i) = (RND * 5) - 2
NEXT
' Menyaem elementi
FOR i = 1 TO 11
IF K(i) < 0 THEN K(i) = 10
NEXT: CLS
' Pechataem massiv
FOR i = 1 TO 11
PRINT K(i)
NEXT
Тестирование выполнено в программе QB64 ( Скачать )