  Let $X(Q)=QC$ be a group, where $Q$ is a generalized quaternion group and $C$
is a cyclic group such that $Q\cap C=1$. In this paper, $X(Q)$ will be
characterized and moreover, a complete classification for that will be given,
provided $C$ is core-free. For the reason of self-constraint, in this paper a
classification of the group $X(D)=DC$ is also given, where $D$ is a dihedral
group and $C$ is a cyclic group such that $D\cap C=1$ and $C$ is core-free.
Remind that the group $X(D)$ was recently classified in [12], based on a number
of papers on skew-morphisms of dihedral groups. In this paper, a different
approach from that in [12] will be used.
