I am new to C# and I have a problem.I want to get user input for some numbers(not fixed numbers) and find the average of the numbers entered.I figured that I could store the numbers in an array and then go from there.How do I do that?
Thanks.
Array question
3 Answers
Know the answer? Post it. Somebody with the same question will find it here.
Mike GoldRank #50 · 30.6K pointsPosted Jul 10, 2006, 7:27 PM EDT
-Mike G.
Tina5 pointsPosted Jul 11, 2006, 1:17 PM EDT
Anyway, I really need help with this.Please help
Solitaire85 pointsPosted Jul 12, 2006, 2:46 PM EDT
Begin with a counter and accumulator.
Use a loop to have user enter a number to add, or zero to stop.
Add that number on to the accumulator (total).
Increment the counter if the number entered is not a zero.
Stop the loop when the number entered is a zero.
Divide the total by the counter to get the average.
2 short replies
Tina5 pointsPosted Jul 14, 2006, 6:46 AM EDT
sudheer kulkarni2 pointsPosted Jul 20, 2006, 3:30 AM EDT