Q. What is the output of the following code?
Code:
int x = 10; int y = 20; int z = x + y; System.out.println(z);
β
Correct Answer: (C)
30
Explanation: The values of x and y are added and assigned to z, which is then printed.