CLS
DIM a(9)
RANDOMIZE TIMER
FOR i = 1 TO 9
a(i) = INT(RND * 200) - 100
NEXT i
PRINT "Massiv A(9)"
FOR i = 1 TO 9
PRINT a(i);
NEXT i
PRINT
n = 0
FOR i = 1 TO 9
IF a(i) > 0 THEN n = n + 1
NEXT i
DIM b(n)
k = 0
FOR i = 1 TO 9
IF a(i) > 0 THEN k = k + 1: b(k) = i
NEXT i
PRINT "Massiv B"
FOR i = 1 TO n
PRINT b(i);
NEXT i
PRINT
p = 1
FOR i = 1 TO n
IF b(i) MOD 2 = 0 THEN p = p * b(i)
NEXT i
PRINT "proizvedenie chetnih elementov massiva B="; p
END
Тестирование выполнено в программе QB64 ( Скачать )