Enter a number, if it is even, divide it by 4, if it is odd, multiply it by 5 (Pascal)
August 25, 2021 | education
| program zz1;
var a: integer; // introduce a variable of integer type
b: real; // enter a variable of non-integer type
begin
write (‘enter the given number’); // enter a number from the keyboard
read (a);
if a mod 2 = 0 // check the condition, if the initial number is even, then
then b: = a / 4 // calculate the answer, divide the original number by four
else b: = a * 5; // calculate the answer by multiplying the original number by five
write (‘Received response =’, b: 5: 2); // display the answer in the format of five characters for the whole number and two characters after the dot
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.