Given an array X (N). find the product of those array elements whose values are in the interval [A, B]

Given an array X (N). find the product of those array elements whose values are in the interval [A, B] and are multiples of 3 or 5

program zz1;
const n = 6; // set the number of elements in the array
var i, s, a, b: integer; // set variables of integer type
m: array [1..n] of integer;
begin
write (‘enter a and b’);
read (a, b);
for i: = 1 to n do // write numbers in the array at random
m [i]: = random (46);
for i: = 1 to n do // display the array on the screen
write (m [i], ”);
writeln;
s: = 1;
for i: = 1 to n do // check if the array element satisfies the given conditions, then multiply it by the product
begin if (m [i]> a) and (m [i] <b) and ((m [i] mod 3 = 0) or (m [i] mod 5 = 0)) then s: = s * m [i]; end;

write (‘the product of the given elements =’, s); // display the answer
end.



One of the components of a person's success in our time is receiving modern high-quality education, mastering the knowledge, skills and abilities necessary for life in society. A person today needs to study almost all his life, mastering everything new and new, acquiring the necessary professional qualities.