There are k Components comprising a total of n vertices. To form each of the component, you need to add vertices to it.
Only after adding the first vertex in each of the k components, none of the edge is introduced. For the rest of the vertices, an edge is introduced.
So, total number of edges will be n-k i.e.option (B)