Computer Science, asked by dashingboyoh, 6 months ago

Write a program to input values for ‘m’ and ‘n’ and using mathematical method perform the

following operations in one program:

(i) Print m raised to the power n [i.e. mn

]

(ii) Print the square root of m.

(iii) Print the cube root of n.



Answers

Answered by navylover2916
8

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);

}

}

Answered by jamwantsingh1122
0

Answer:

hope it is correct and it helps you

Answered by jamwantsingh1122
0

Answer:

hope it is correct and it helps you

Attachments:
Similar questions