  Interstellar complex organic molecules (iCOMs) are assumed to be mainly
formed on dust-grain surfaces. However, neutral gas-phase reactions in the
interstellar medium (ISM) can play an important role. In this paper, by
investigating the reaction between aldehydes and the cyano radical, we show
that both formaldehyde (CH$_2$O) and acetaldehyde (CH$_3$CHO) can lead to the
formation of formyl cyanide (HCOCN). Owing to accurate quantum-chemical
computations followed by rate constant evaluations, we have been able to
suggest and validate an effective mechanism for the formation of HCOCN, one of
the molecules observed in the ISM. Quite interestingly, the mechanism starting
from CH$_2$O is very effective at low temperature, while that involving
CH$_3$CHO becomes more efficient at temperatures above 200 K.
