Multiplication help

Hi,
I am kinda new to programming and I wanted to know..
1.Let's say I have a variable x. (Int x)
2.Using a for loop I am letting the person to type 10 numbers(any,both positive and negative) with the command cin>>x.
3. I have 10 numbers (let's make them 1,2,3,4,5,6,7,8,9,10) and I want to multiplicate them all. Is there a posibility to do that and how? (I'm using the only variable x and an array to cout my results to a txt file)

Thanks!

Last edited on
int total = 0;
for(...) {
std::cin >> x;
total *= x;
}
Last edited on
@Boilerplate

total must be initialised to 1, not 0.
@Boilerplate , @integralfx,
Worked like a charm, thanks!
Topic archived. No new replies allowed.