Friday, December 14, 2012

Java Tutorial 7 Source Code

import java.lang.Math; public class Tutorial { public static void main(String[] args) { byte a = (byte) Math.pow(9,2); System.out.println(a); double b = Math.sqrt(82); System.out.println(b); byte c = (byte) Math.max(82, 127); System.out.println(c); byte d = (byte) Math.min(82, 127); System.out.println(d); byte e = (byte) Math.ceil(1.001); System.out.println(e); byte f = (byte) Math.floor(1.99); System.out.println(f); byte g = (byte) ((Math.random() * 100) + 1); System.out.println(g); byte h = (byte) Math.abs(5-100); System.out.println(h); } }

No comments:

Post a Comment