Answer:
If a halogenoalkane is heated under reflux with a solution of sodium or potassium cyanide in ethanol, the halogen is replaced by a -CN group and a nitrile is produced. Heating under reflux means heating with a condenser placed vertically in the flask to prevent loss of volatile substances from the mixture.
The bromine (or other halogen) in the halogenoalkane is simply replaced by a -CN group - hence a substitution reaction. In this example, butanenitrile is formed