Write a program in Pascal if two numbers are positive, then square both numbers
September 16, 2021 | education
| Write a program in Pascal if two numbers are positive, then square both numbers, if both numbers are negative, then find their modulus.
var
a, b: integer;
begin
writeln (‘Enter value a.’);
readln (a);
writeln (‘Enter value b.’);
readln (b);
if (a> 0) and (b> 0) then writeln (a * a);
if (a> 0) and (b> 0) then writeln (b * b);
if (a <0) and (b <0) then writeln (abs (a));
if (a <0) and (b <0) then writeln (abs (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.