Java Program for Math Fun

Here is a simple java program for math fun…

import java.io.*;
import java.lang.*;
class Mathfun
  {
            public static void main(String args[]) throws IOException
     {
        System.out.println(“ttt***Math functions***”);
        System.out.println(“ttt Exponention functions***”);
    System.out.println(“Exponential value” + Math.exp(5));
    System.out.println(“Power value ” + Math.pow(4,2));
    System.out.println(“ttt***Trigonometrial functions***”);
    System.out.println(“sin Value ” + Math.sin(30));
    System.out.println(“cos Value = ” + Math.cos(60));
    System.out.println(“tan Value = ” + Math.tan(30));
    System.out.println(“a cos value ” + Math.acos(30));
    System.out.println(“ttt***Ordinary Math functions***”);
    System.out.println(“Absolute Value ” + Math.abs(-6));
    System.out.println(“Round value ” + Math.round(3.45));
    System.out.println(“floor value ” + Math.floor(4.9));
    System.out.println(“Ceil Value ” + Math.ceil(4.1));
    System.out.println(“Square value ” + Math.sqrt(16));
   }
}      

Add Comment