Step 1: Understanding the reaction.
Prolonged heating of glucose (C$_6$H$_{12}$O$_6$) with hydroiodic acid (HI) results in the reduction of glucose to n-hexane (C$_6$H$_{14}$). This confirms the presence of a straight-chain structure of six carbon atoms in the glucose molecule.
Step 2: Analyzing the options.
(A) Presence of carbonyl group: This is incorrect because the reaction with HI leads to the reduction of glucose, which involves the removal of functional groups, not just the presence of a carbonyl group.
(B) Presence of all six carbon atoms in a straight chain: This is the correct answer, as the reduction of glucose confirms that all six carbon atoms form a straight chain.
(C) Presence of primary alcoholic group: This is not the main feature confirmed by this reaction. Glucose has primary alcoholic groups, but the reaction confirms the straight-chain structure.
(D) Presence of aldehydic carbonyl group: This is incorrect, as the aldehyde group is reduced during the reaction to form n-hexane.
Step 3: Conclusion.
The correct answer is (B) Presence of all six carbon atoms in a straight chain.