Write a program in Java to perform the following operations using mathematical methods i. Print 6 raised to the power 3. ii. Print the result of 16.32 using ceil(). Print the result of 29.42 using floor). iv Print the cube root of 256. Print the rounded off value of 136.662. V. 115
Answers
Answered by
7
import java.util.*;
public class MathOpts
{
public static void main (String args [])
{
System.out.println("Power : "+Math.pow(6,3));
System.out.println("Ceil : "+Math.ceil(16.32));
System.out.println("Floor : "+Math.floor(29.42));
System.out.println("Cbrt : "+Math.cbrt(256.0));
System.out.println("Round : "+Math.round(136.662));
}
}
Output :
Power : 216.0
Ceil : 17.0
Floor : 29.0
Cbrt : 6.349604207872798
Round : 137
Answered by
0
Answer:
class Math
{
public static void main( String args [ ] )
{
System .out . println ("
Similar questions