Programa Desviacion Estandar

Enviado por Programa Chuletas y clasificado en Informática y Telecomunicaciones

Escrito el en español con un tamaño de 764 bytes

Desviacion Estandar a Vector de 5 componentes:



Program DesEst;
Uses wincrt;
Type vector:array[1..5] of real;
Var i: integer;
SX,SX2,DS:real;
X:vector;
Const n:=5;

Begin
clrscr;
SX:=0;
SX2:=0;
DS:=0;
For i:=1 to 5 do
Begin
Writeln('X[i]= ');
Readln(X[i]);
End;


For i:=1 to 5 do
Begin
SX:=SX + X[i];
SX2:=SX2 + SQR(X[i]);
End;

DS:= SQRT((SX2/n) - SQR(SX/n));
Writeln('La Desviacion Estandar es = ',DS);

readkey;
End.

Entradas relacionadas: