Write a program in which the value is calculated by the formula a + b

Write a program in which the value is calculated by the formula a + b, if a is an odd number and a * b, if a is an even number (if a mod is not equal to 0)

program z1;

var a, b, c: integer; // 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);
if (a mod 2 <> 0) then c: = a + b; // check the number for oddness and calculate the value using the given formula
if (a mod 2 = 0) then c: = a * b; // check the number for evenness and calculate the value using the given formula

writeln (‘received result =’, c); // 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.