Sabtu, 09 April 2011

Operator Aritmatika dengan java

public class TestAritmatika {

public static void main(String args[]) {
short x=6;
int y=4;
float a=12.5f;
float b=7f;

System.out.println(" x = " + x + ", y = " + y);
System.out.println("x + y =" +(x+y));
System.out.println("x - y =" +(x-y));
System.out.println("x * y =" +(x*y));
System.out.println("x / y =" +(x/y));
System.out.println("x % y =" +(x%y));
System.out.println("a =" + a + ", b = " +b);
}


}

Tidak ada komentar:

Posting Komentar