Write a program that finds the sum of odd numbers and the product of even numbers in the range 20 to 35.

Making a cycle

Variable from 20 to 35 for i: = 1 to 10 do

Next, we check the division of numbers by 2 (even)

We add them up and display the answer, if it is not divisible by 2, then we multiply the odd numbers and display the answer.

Using the conditions If, else, then

Let’s compose a program in the Pascal programming language

var a, b, i: integer;

begin

a: = 0;

b: = 1;

for i: = 20 to 35 do

if i mod 2 = 0 then a: = a + i else b: = B * i;

write (a, ”, b)

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.