Procedure Mean(X,Y:real; Var AMean,GMean:real);
Begin
AMean:=(X+Y)/2;
GMean:=Sqrt(X*Y);
End;
Var
A,B,C,D,S:real;
Begin
Write('A = ');ReadLn(A);
Write('B = ');ReadLn(B);
Write('C = ');ReadLn(C);
Write('D = ');ReadLn(D);
WriteLn;
Mean(A,B,S,B);
WriteLn('AMean(A,B) = ',S);
WriteLn('GMean(A,B) = ',B);
WriteLn;
Mean(A,C,S,C);
WriteLn('AMean(A,C) = ',S);
WriteLn('GMean(A,C) = ',C);
WriteLn;
Mean(A,D,S,D);
WriteLn('AMean(A,D) = ',S);
WriteLn('GMean(A,D) = ',D);
End.
A = 1
B = 2
C = 3
D = 4
AMean(A,B) = 1.5
GMean(A,B) = 1.4142135623731
AMean(A,C) = 2
GMean(A,C) = 1.73205080756888
AMean(A,D) = 2.5
GMean(A,D) = 2