Option (B) is correct.
Explanation: Use the solutions to decide what kind of oxide each one is, then predict what it reacts with.
XO gives a solution that turns red litmus blue, so its solution is basic: XO is a basic oxide (the oxide of a metal, such as magnesium oxide). A basic oxide reacts with an acid to give a salt and water:
MgO+2HCl→MgCl2+H2O
YO2 gives a solution of pH about 4, which is acidic: it is an acidic oxide (the oxide of a non-metal, such as carbon dioxide). An acidic oxide reacts with a base to give a salt and water:
2NaOH+CO2→Na2CO3+H2O
Option (A) is wrong: XO is basic, so it does not react with a base such as sodium hydroxide.
Option (C) is wrong: it swaps the two; a basic oxide reacts with an acid, and an acidic oxide reacts with a base.
Option (D) is wrong: dissolving in water does not decide the reaction; YO2 is acidic and does not react with an acid.
