  It is proved that the semigroups
$\mathrm{\mathbf{End}}(\boldsymbol{B}_{\omega})$ and
$\mathrm{\mathbf{End}}(\boldsymbol{B}_{\mathbb{Z}})$ of the endomorphisms of
the bicyclic semigroup $\boldsymbol{B}_{\omega}$ and the endomorphisms of the
extended bicyclic semigroup $\boldsymbol{B}_{\mathbb{Z}}$ are isomorphic to the
semidirect products $(\omega,+)\rtimes_\varphi(\omega,*)$ and
$\mathbb{Z}(+)\rtimes_\varphi(\omega,*)$, respectively.
