Padd Solutions

Converted by Falcon Hive

public class Calculations
{
    public static void main (String[] args)
    {
        //power
        System.out.println (Math.pow (5, 3) );
       
        //square root
        System.out.println (Math.sqrt (9) );
       
        //absolute value
        System.out.println (Math.abs (-5) );
       
        //some random number
        System.out.println ("Check it out - RANDOM NUMBERRR!!!!");
        System.out.println ( (int) (Math.random () * 10) + 1 );
        //                                           /\ range
        //                                                /\ base
       
        //number between 50-100
        System.out.println ( (int) (Math.random () * 51) + 100 );
        //number between 0-1000
        System.out.println ( (int) (Math.random () * 1001) );
    }
}

(0) Comments

Post a Comment