KTH ROOT USING LOG

i was trin to approach that using log method instead of newtons method…
kindly check and correct the code if possible…

regards

code linkl

consider this case as well
if k==1 cout<<n<<endl;

i applied k==1 still not able to submit one testcase…

for input
10^12 6

your code output is 99 but it should be 100

So how to do that like…i m asking for.furthur point of to find these thing…!!

if you want to use inbuilt function then try this

void calk(long long n,long long k)
{
long long x=pow(n,(long double)(1)/k);
cout<<x<<endl;
}

this is simple and correct

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.