What is the output of the following code?
int x = 10;
int y = 20;
int z = x + y;
System.out.println(z);
a) 10
b) 20
c) 30
d) 40
Solution: c) 30
Explanation: The values of x and y are added and assigned to z, which is then printed.