Java Square Root Cube Root Square and Cube of Number

Java Square Root Cube Root Square and Cube of Number

This code will take the users input and give the square root cube root square and cube of the number using Java.


import java.util.*; 
public class math { 
    public static void main(String args[]){         Scanner sc=new Scanner(;     
    int num;     num=sc.nextInt();     
System.out.println("Square Root of "+ num + " is: "+ Math.sqrt(num));     
System.out.println("Cubed Root of "+ num + " is: "+ Math.cbrt(num));     
    System.out.println("Square of "+ num + " is: "+ Math.pow(num, 2));         System.out.println("Cube of "+ num + " is: "+ Math.pow(num, 3));         }}

Click here to run this code

More Free Code Examples:

Java Code to Reverse a String

Java Current Time and Date Program

Java Random Numbers

Free Code Examples is a Growing Project check in frequently for our latest additions

Try these Fun Games by Bobbie:

Travel Blast Game New York

Play and Learn Russian

Battlestarship Game

Take a look at these Groovy Codes:

Fun IQ Test

Html Svg Starburst

Javascript Particles Fishes

Read the Latest Breaking Programming and Tech News, Great Articles and Tips:

Codenewz Programming and Tech News


  1. thanks for sharing this informative blog .visit Cube Root for more information


Post a Comment

Popular posts from this blog

Multi-tap Keypad Text Entry

HTML5 Crossword 1