# Write a program to calculate the product of 30 random natural numbers.

October 3, 2021 | education

| program zz1;

var i, a, S: integer; // set variables of integer type

begin

s: = 1; // set the initial value for the product

for i: = 1 to 30 do // organize a loop for 30 repetitions

begin

a: = random (5) + 1; // get a natural number at random

s: = s * a; // calculate the product by multiplying the next natural number

end;

writeln (‘Received work =’, s); // display the answer

end.