Link to home
Start Free TrialLog in
Avatar of ltdanp22
ltdanp22Flag for United States of America

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
ASKER CERTIFIED SOLUTION
Avatar of sunnycoder
sunnycoder
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial