If you know how to write a function that call itself perhaps that may be the best solution for sum=1+2^2+3^3+4^4..+n^n . And the function should stop calling itself when the nth Power is reached.
The N^S is that N Multiply itself N*N*N*N...N S number of times
I know . .
Who does not know!!
If you know how to write a function that call itself perhaps that may be the best solution for sum=1+2^2+3^3+4^4..+n^n . And the function should stop calling itself when the nth Power is reached.
My problem is I just need to solve this function, I do not want detail in the C++
If you know what N^S means, you should be able to write down a function that calculates it. And once you've done that, calcuating your sum should be easy.
If you can't work out the general function directly, try a simpler one. For example, a function that returns the powers or two.