Click here to Skip to main content
15,886,068 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi,

how to calculate the simple moving average using arrays concept.

C#
int[] numbers = { 12, 12, 21, 34, 34, 342, 12, 21, 32, 42, 321, 23, 23, 34, 34, 21, 12, 12, 21, 21, 43, 34, 43, 5, 43, 2, 36, 6, 46, 4, 5, 4, 56, 65, 56, 34, 67, 4, 54, 76, 54, 87, 87, 3, 2, 45, 4, 65, 7, 56, 56, 45, 4, 54, 54, 54, 9, 5, 45, 54, 45, 45, 45, 78, 34, 65, 87, 5, 68, 9, 6, 56, 56, 78, 56, 45, 4, 34, 34, 37 };


please help me.
Posted
Updated 6-Aug-11 3:46am
v2
Comments
thatraja 6-Aug-11 9:41am    
Do you want the average value of the array?

1 solution

I assume you asked about Simple Moving Average, if I am right then following might be helpful,

A Simple Moving Average Algorithm[^]

Simple_moving_average#C.23[^]

Hope it helps :)
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 6-Aug-11 22:33pm    
Looks like the answer, a 5.
--SA
Mohammad A Rahman 7-Aug-11 0:02am    
Thanks SA :)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900