The correct answer is B. After studying the habits of pit vipers, the pits, which serve as infrared sensors and enable the snakes to seek heat, evolved to detect danger rather than to hunt prey.
Explanation:
A sentence contains a dangling modifier in the case a modifier (word or words that describe a noun) is not placed beside the noun it modifies, instead, the modifier seems to "dangle" with no noun to modify. This is the case of the sentence B because in this the modifier "After studying the habits of pit vipers" has been placed beside "the pits"; however, it is not supposed pits study themselves and therefore the modifier seems to dangle as it is not placed beside the noun it should modify.