Given two integers N and K, the task is to find the Nth root of the K.
Input: N = 3, K = 8
Cube root of 8 is 2. i.e. 23 = 8
Input: N = 2, K = 16
Square root of 16 is 4, i.e. 42 = 16
Approach: The idea is to use logarithmic function to find the Nth root of K.
Let D be our Nth root of the K,
Apply logK on both the sides –
Below is the implementation of the above approach:
Don’t stop now and take your learning to the next level. Learn all the important concepts of Data Structures and Algorithms with the help of the most trusted course: DSA Self Paced. Become industry ready at a student-friendly price.
- N-th root of a number
- Square root of a number using log
- Smallest root of the equation x^2 + s(x)*x - n = 0, where s(x) is the sum of digits of root x.
- Find cubic root of a number
- Find root of a number using Newton's method
- C program to find square root of a given number
- Primitive root of a prime number n modulo n
- Find Nth positive number whose digital root is X
- Print a number containing K digits with digital root D
- Find Cube root of a number using Log function
- Square root of a number without using sqrt() function
- Square root of a number by Repeated Subtraction method
- Floor value Kth root of a number using Recursive Binary Search
- Find square root of number upto given precision using binary search
- Fast method to calculate inverse square root of a floating point number in IEEE 754 format
- Check if a number is perfect square without finding square root
- Square root of an integer
- Program to calculate Root Mean Square
- Fast inverse square root
- Check whether one root of the Quadratic Equation is twice of other or not
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.