ltdanp22
asked on
Arithmetic inside arrays
Why is is that when I create my array with this line:
double b[6] = {1/6, 5/24, 11/120, 19/720, 29/5040, 1/840};
and then cout the contents using:
for (Counter2 = 0; Counter2 < 6; Counter2++)
cout << "b[" << Counter2 << "]: " << b[Counter2] << endl;
The resulting output is:
b[0]: 0
b[1]: 0
b[2]: 0
b[3]: 0
b[4]: 0
b[5]: 0
double b[6] = {1/6, 5/24, 11/120, 19/720, 29/5040, 1/840};
and then cout the contents using:
for (Counter2 = 0; Counter2 < 6; Counter2++)
cout << "b[" << Counter2 << "]: " << b[Counter2] << endl;
The resulting output is:
b[0]: 0
b[1]: 0
b[2]: 0
b[3]: 0
b[4]: 0
b[5]: 0
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.