Operazioni pił comuni con gli interi
public class Interi
{
public static void main(String[] args)
{
int A, B;
A=10;
B=3;
//operatori aritmetici unari
System.out.println(" + A = " + (+ A));
System.out.println(" - A = " + (- A));
//operatori aritmetici binari
System.out.println("A + B = " + (A + B));
System.out.println("A - B = " + (A - B));
System.out.println("A * B = " + (A * B));
System.out.println("A / B = " + (A / B));
System.out.println("A % B = " + (A % B));
System.out.println("");
//operatori condizionali (di confronto)
System.out.println("A < B = " + (A < B));
System.out.println("A <= B = " + (A <= B));
System.out.println("A > B = " + (A > B));
System.out.println("A >= B = " + (A >= B));
System.out.println("A == B = " + (A == B));
System.out.println("A != B = " + (A != B));
}//main()
}//Interi
Osserva
-
/, %
<=, >=, ==, !=
|