DIM a(20)
FOR i = 1 TO 20
a(i) = RND(1) / 2
NEXT
PRINT "massiv"
FOR i = 1 TO 20
PRINT a(i); " ";
NEXT
k = 1
PRINT
DO
IF a(k) < .25 THEN m = m + 1: PRINT "k="; k; "element="; a(k)
k = k * 2
LOOP UNTIL k > 20
PRINT
PRINT "takih elementov="; m
Тестирование выполнено в программе QB64 ( Скачать )