Solution:
Concept: Write the electronic configuration of each element first. Elements with 1–3 valence electrons are metals, those with 4–7 are non-metals, and an element with a complete octet is a noble gas.
Step 1 — Write the configurations.
We fill the shells in order: P (13) is 2, 8, 3; Q (7) is 2, 5; R (10) is 2, 8.
Step 2 — (i) The element giving a basic gas with hydrogen.
Q has 5 valence electrons, so it is a non-metal of group 15 (nitrogen). It combines with hydrogen to form ammonia, the only common basic gas. The answer is Q.
N2+3H2⇌2NH3
Step 3 — (ii) The element with zero electron affinity.
R (2, 8) already has a complete octet (it is the noble gas neon), so it has no tendency to accept an extra electron. Its electron affinity is zero, and the answer is R.
Step 4 — (iii) The element forming an ionic compound with chlorine.
P (2, 8, 3) is a metal (aluminium) that loses its 3 valence electrons, while each chlorine atom gains one. P therefore combines with chlorine to form the chloride AlCl₃, and the answer is P:
2Al+3Cl2→2AlCl3
Q is a non-metal and R is inert, so neither forms an ionic chloride.

Watch out: Use the letters only in the final answer; the element names are given in the steps just to explain.
Note: Anhydrous aluminium chloride in fact shows considerable covalent character, but P is the only metal in the table and is the expected answer.
Therefore, (i) Q; (ii) R; (iii) P.