Value is x10 for no reason

I recently made a tiny program to test a mathematical algorithm, but i'm getting some output I can't explain. I think I must have changed a setting or something as this is weird as hell, but if anyone knows what I might've done it'd be greatly appreciated as I'm stumped.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#include <iostream>
using namespace std;

int main()
{
    int n3xTotal = 0;
    int n5xTotal = 0;
    int nAddCount = 0;
    int i = 5;
    
          cout << "i = " << i << endl;
          nAddCount = i;
          cout << "nAddCount = " << nAddCount;
          cout << n3xTotal << endl;
    
    system("PAUSE");
    return 0;
}


output:
i = 5
nAddCount = 50
Press any key to continue... 
remeber to use endl at row 13
oh..... I hang my head in stupid shame. :P Right... thanks anyway
closed account (zb0S216C)
The new-line escape character constant is the more efficient choice since std::ostream::endl() has significant overhead in relation to the new-line escape character.

Wazzak
Last edited on
Topic archived. No new replies allowed.