Consider the following code segment. int x = 5; int y = 6; /* missing code */ z = (x + y) / 2; Which of the following can be used to replace /* missing code */ so that the code segment will compile? I.int z = 0; II.int z; III.boolean z = false;

Answer :

krlosdark12

Answer:

II. int z;

Step-by-step explanation:

int z;

is the best option, because on the next line you will define the variable as

z = (x + y) / 2;

you can also use int z=0; but it is not necessary according to the code segment given.

Other Questions