Find the arithmetic mean and geometric mean of two numbers. Write a program (Pascal)
September 21, 2021 | education
| program zz1;
var
a, b: real; // set variables of non-integer type
begin
writeln (‘Enter two numbers:’);
readln (a, b); // enter two given numbers from the keyboard
writeln (‘The arithmetic mean of numbers’, a, ‘and’, b, ‘equals’, (a + b) / 2: 5: 2); // display the first answer in the format of five characters for the whole number and two characters after the dot
writeln (‘Geometric mean’, a, ‘and’, b, ‘equals’, sqrt (a * b): 5: 2); // display the first answer in the format of five digits for the whole number and two digits 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.