Hi there, let me explain what i need to accomplish.
So my task is to create this ax3+bx2+cx+d=0 mathematical solution with do.. while operator.
Task described:
Integers are entered a, b, c, d. Find all ax3+bx2+cx+d=0 roots of the equation.
Root's have to be found in "d" divisor. For example d=5 - which divides with 5 and 1 and the same with negatives, if i understood correctly. And then those divisors have to be placed in x'es of equitation. If current equitation result = 0 and if it is 0 then divisor is the root.
Hope i made a point.
So this is mine code, i would be really grateful if You could review these several lines of code, and comment if everything is in correct place and working as it should be, and if you are familiar with this you could throw a little advise how to improve it if there is something to add.
Finding all the divisors of a number is trivial. A for loop can be used to test all natural numbers less than or equal to the number in question. This trivial solution is definitely not the most efficient, but it will do the job well enough for small numbers.
I posted an example here: http://coliru.stacked-crooked.com/a/d8db75658c3fae12