write a program to input for "m" and "n" using mathematical method perform the foolowing operators in one program print m raised to the power n
Answers
Answered by
1
Answer:
import java.util.Scanner;
public class practise3 {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
System.out.println("ENTER THE VALUE OF 'm' ");
double m = scan.nextDouble();
System.out.println("ENTER THE VALUE OF 'n' ");
double n = scan.nextDouble();
double raised = Math.pow(m, n);
double squareroot = Math.sqrt(m);
double cuberoot = Math.cbrt(n);
System.out.println("'m' RAISED TO THE POWER 'n' IS : "+raised);
System.out.println("THE SQUARE ROOT OF 'm' IS :"+squareroot);
System.out.println("THE CUBEROOT OF 'n' IS : "+cuberoot);
}
}
Similar questions
History,
4 months ago
Computer Science,
4 months ago
India Languages,
8 months ago
English,
1 year ago
English,
1 year ago