Enter the number if it is even, divide it by 4, if not even, multiply by 5.
August 16, 2021 | education
| Since the result can be fractional, for example, when entering 2, we should get 0.5, then we have to store the result in a real data type.
program Example;
var
a: integer;
result: real;
begin
write (‘Enter a number’);
readln (a);
if (a mod 2) = 0 then result: = a / 4 else result: = a * 5;
writeln (‘Get it’, result);
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.