Belajar Mengoperatorkan Aritmatika dengan java

Bookmark and Share

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);
}


}

{ 0 komentar... Views All / Send Comment! }

Posting Komentar