We compute the cohomology rings of $U(n)$ and $Sp(n)$ and of their Stiefel varieties by using the Serre spectral sequence. This approach is much simpler than the usual method, that of using the cell structures. The argument here also shows that the cohomology of $U(n)$ is built from those of $U(n - 1)$ and $S^{2n - 1}$ through a fiber bundle; a similar result holds for $Sp(n)$.}