- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Java program to find the cube root of a given number
Following is an example to find the cube root of a given number.
Program
import java.util.Scanner; public class FindingCubeRoot { public static void main(String args[]){ double i, precision = 0.000001; System.out.println("Enter a number ::"); Scanner sc = new Scanner(System.in); int num = sc.nextInt(); for(i = 1; (i*i*i) <= num; ++i); for(--i; (i*i*i) < num; i += precision); System.out.println("Cube root of the given number is "+i); } }
Output
Enter a number :: 125 Cube root of the given number is 5.0
- Related Articles
- Java program to find a cube of a given number
- C++ Program to calculate the cube root of the given number
- Python Program to calculate the cube root of the given number
- Java program to find the square root of a given number
- How to find the cube root of a number in JavaScript?
- Find the smallest number by which the given number must be divided to obtain a perfect cube also find the cube root of the quotient: $576$.
- Find the cube root of following number n-2744
- C++ Program to count square root cube root and both in given range
- Find the cube root of 512.
- Find the cube root of 1404928.
- Find the Cube Root Of $-5$
- Find the cube root of 216.
- Find the cube root of $1.728$.
- Find the cube root of $-0.001331$.
- Find the cube root of $0.000001$.

Advertisements