# Pascal. Find the product of integers from a to b, where a and b are entered from the keyboard.

July 29, 2021 | education

| program zz1;

var a, b, r, i: int64; // set variables of integer type

begin

write (‘enter the first number’); // enter the first number from the keyboard

read (a);

write (‘enter the second number’); // enter the second number from the keyboard

read (b);

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

for i: = a to b do // organize a loop in which we iterate over all the numbers from a to b

r: = r * i; // calculate the product of numbers from a to b by the formula

write (‘product of numbers from’, a, ‘to’, b, ‘=’, r); // 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.