ex44.pp 449 B

12345678910111213141516171819202122
  1. Program Example44;
  2. { Program to demonstrate the Sum function. }
  3. Uses math;
  4. Type
  5. TExArray = Array[1..100] of Float;
  6. Var
  7. I : Integer;
  8. ExArray : TExArray;
  9. begin
  10. Randomize;
  11. for I:=1 to 100 do
  12. ExArray[i]:=(Random-Random)*100;
  13. Writeln('Max : ',MaxValue(ExArray):8:4);
  14. Writeln('Min : ',MinValue(ExArray):8:4);
  15. Writeln('Sum : ',Sum(ExArray):8:4);
  16. Writeln('Sum (b) : ',Sum(@ExArray[1],100):8:4);
  17. end.