INPUT "vvedite n=", n
INPUT "vvedite p=", p
DIM a(n)
FOR i = 1 TO n
INPUT "vvedite element=", a(i)
NEXT
PRINT "massiv"
FOR i = 1 TO n
PRINT a(i); " ";
NEXT
pr = 1
PRINT
PRINT "kratnye "; p; "=";
FOR i = 1 TO n
IF a(i) MOD p = 0 THEN PRINT a(i); " ";
NEXT
Тестирование выполнено в программе QB64 ( Скачать )