I have to prove that in a graph $G$ with $n$ vertices and $n$ edges which has no isolated or pendant vertices, every vertex has degree 2.
Now I know that $$\sum_{v\in V} d(v)=2|E|=2n$$
but I suppose I also have to prove every vertex has same degree and I'm not sure how to do that.