a group of 10 six and twelve volt batteries are wired in a series. the sum of their voltage is 84 volts. how many of each type of the battery are used

Quiz style answer:

Take half and half, if there is too much, change a 12 for a 6.
5*6+5*12=90, 6 volts too much, so it is 6*6+4*12=84.

Serious answer:
Let
S = the number of 6 volts be
10-S = the number of 12 volts
6S + 12(10-S) = 84
Solve for S.