My task is to write a program which reads in the number of roots, a value increment, and a precision and outputs a table of roots x1/2, x1/3, … for the given number of roots and values of x equal to i times the increment up to and including 100.
So far I have managed to get everything right but the calculation of the roots themselves so the output is just 1s like this:
c1 and c2 are ints. You're doing integer division to compute the exponent. 1 divided by any int is 0. c2 to the 0 power is 1.
PLEASE USE CODE TAGS (the <> formatting button) when posting code.
It makes it easier to read your code and also easier to respond to your post. http://www.cplusplus.com/articles/jEywvCM9/
Hint: You can edit your post, highlight your code and press the <> formatting button.