AVERAGE

 !Program name: AVERAGE

!Average of the data A, B and C

Program average

Real A,B,C,AV

Data A,B,C/5.0,2.0,3.0/

AV=AVRAGE(A,B,C)

Print *, 'The numbers ',A,B,C

Print *, 'have average= ',AV

End

 

REAL function AVRAGE(X,Y,Z)

REAL X,Y,Z,SUM      ! dummy arguments

SUM=X+Y+Z

AVRAGE=SUM/3.0

RETURN

end

Comentários

Postagens mais visitadas deste blog

RECURSIVE

HYDROGEN-RADIAL

RUNGE-KUTTA