ex50.pp 405 B

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