Fortran program for arithmetic, RMS, geometric, and harmonic means

Join the discussion
Registration is free. Ask a follow-up in this thread, or start your own.
3 replies · 3K views
rk2ray
Messages
7
Reaction score
0
I am learning Fortran and I am able to write code for 3 number means. Now For computing it for set of numbers is not getting in my mind. I am not able to do it.

Writing a single Fortran program that calculates the arithmetic mean, rms (root-mean-square) average, geometric mean, and harmonic mean for a set of numbers. Running the code for the following four sets of numbers.
(a) 4, 4, 4, 4, 4, 4, 4
(b) 4, 3, 4, 5, 4, 3, 5
(c) 4, 1, 4, 7, 4, 1, 7
(d) 1, 2, 3, 4, 5, 6, 7

Thanks for the help.
 
Physics news on Phys.org
You've already programmed the formulas. Are you having trouble doing the arithmetic?