Forums / General / reading from a list of numbers....and....

reading from a list of numbers....and....

hi,
i'm very new to c++ and was wondering if someone could help me with this:

i would like to ask the user to enter 10 numbers......
then i'd like to add these numbers ONE by ONE
then take the Standard Dev.
then take the Average.
then report it back to the user


could anyone help please :-(
 

BinaryBoy's reply to sssb2000 #1015 @

Is that homework?

There are better ways of doing this, but this should get you started.

[code]
#include <iostream>

int numbers[10];
for(int i = 0; i < 10; ++i) // Loop 10 times
{
std::cout << "Enter a number: "; // Display prompt
std::cin >> numbers; // Get number from user
}

for(int i = 0; i < 10; ++i) // Loop 10 times
{
// Do stuff with each number
std::cout << numbers << std::endl
}
[/code]