What is the output of the following code?
1: public class Main { 2: public static void main(String[] args) { 3: int x = 5 * 8 % 3; 4: System.out.println(x); 5: } 6:}
A.
The * and % have the same operator precedence.
The output is 1 and A is the correct answer.
public class Main { public static void main(String[] args) { int x = 5 * 8 % 3; System.out.println(x); } }