Step 1: Think about what an addition reaction actually needs.
For atoms to add on to a molecule, there must be a multiple bond, a double or triple bond, that can open up and make room for new atoms.
Step 2: Check alkanes first.
Alkanes have only single bonds everywhere, so there is nothing to open up, which is why alkanes undergo substitution reactions instead, swapping a hydrogen for another atom rather than adding on.
Step 3: Check alkenes and alkynes.
Alkenes carry a carbon to carbon double bond and alkynes carry a triple bond, and in both cases one or more of these bonds can break open to let extra atoms such as hydrogen or halogens attach across the carbons.
Step 4: Combine the findings.
Since both classes possess a multiple bond capable of opening up, both alkenes and alkynes are able to undergo addition reactions. \[ \boxed{\text{Both alkenes and alkynes}} \]