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.
Java
import java.util.*;
public class math {
public static void main(String args[]){ Scanner sc=new Scanner(System.in);
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)); }}
thanks for sharing this informative blog .visit Cube Root for more information
ReplyDelete