It almost works, he needs to add 1 to all the results.
I would say the algorithm is OK (but lacking detail); And, the implementation is flawed.
Tim S.
Type: Posts; User: stahta01
It almost works, he needs to add 1 to all the results.
I would say the algorithm is OK (but lacking detail); And, the implementation is flawed.
Tim S.
I suggest only having a single value to test instead of two as you do with "m" and "n".
Edit: I also suggest use "x*x" instead of "pow(x,2)".
Tim S.
Step 4 implies the use of a loop; likely a do/while or while loop.
Suggestion: State the input, the expected output, and the incorrect output from your program.
Tim S.