The correct answer is A. sang.
The sentence “A: Were you singing when I came in? B: Yes, I sang.” is in the past tense. This means that the action of singing happened at a specific time in the past. The verb “sang” is the past tense form of the verb “to sing.”
The other options are not correct because they are not in the past tense. The verb “was” is the past tense form of the verb “to be.” The verb “were” is the plural past tense form of the verb “to be.” The verb “did” is the past tense form of the verb “to do.”
In this case, the speaker is asking about a specific action that happened in the past. The speaker is not asking about a general state of being or a repeated action. Therefore, the verb “sang” is the most appropriate answer.