You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

18 lines
357 B
Java

public class OperatorPrecedence {
public static void main(String[] args) {
int valA = 21;
int valB = 6;
int valC = 3;
int valD = 1;
int result1 = valA / valC * valD + valB;
int result2 = valA / (valC * (valD + valB));
System.out.println(result1);
System.out.println(result2);
}
}