Hopefully it should be clear that in any such graph all components will be complete, i.e., have all possible edges. Thus the only remaining question is how large each component should be?
If there are two components with $a$ and $b$ vertices, $a>1, b> 1$, then together they can have at most
$\binom{a}{2} + \binom{b}{2} = \frac{1}{2} \left(a^2 - a + b^2 - b \right)$ edges.
However, if we place all but one of the vertices in a single component, we could have
$\binom{a+b-1}{2} + \binom{1}{2} = \frac{1}{2} \left(a+b-1\right)\left(a + b - 2\right)$
$=\frac{1}{2} \left(a^2 + 2ab -3a + b^2 - 3b + 2 \right)$ edges.
Subtracting the first quantity from the second gives
$\frac{1}{2}\left(\left(2ab - 3a - 3b +2\right) - \left(-a - b \right)\right) \\=ab-a-b+a \\= (a-1)(b-1) \text{ which is } > 0$
Hence it is better not to have two components with multiple vertices.
This leaves us with the answer that all components should have one vertex except one, which will have $n-k+1$ vertices, for a total of $\binom{n-k+1}{2}$ edges.
in simple connected graph , number of edges ,
$(n-1) \leq e \leq n. \frac{(n-1)}{2}$
in simple unconnected graph with k component , number of edges ,
$(n-k) \leq e \leq (n-k).\frac{(n-k+1)}{2 }$
note :- put k=1 then it will be connected graph .
reference @ http://www.quora.com/What-is-the-maximum-number-of-edges-in-graph-with-n-vertices-and-k-components
another read @ http://stackoverflow.com/questions/24003861/maximum-number-of-edges-in-undirected-graph-with-n-vertices-with-k-connected-com