Computer Science, asked by shumailansari080, 8 months ago

Question-9
(10]
Write a program to input values for 'm' and 'n' and using mathematical method perform the
following operations in one program:
(1) Print m raised to the power n li.e. m")
(ii) Print the square root of m.
(ill) Print the cube root of n.​

Answers

Answered by navylover2916
2

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