Denote by \(\rho (G)\) and \(\kappa (G)\) the spectral radius and the signless Laplacian spectral radius of a graph G, respectively. Let \(k\ge 0\) be a fixed integer and G be a graph of size m which is large enough. We show that if \(\rho (G)\ge \sqrt{m-k}\) , then \(C_4\subseteq G\) or \(K_{1,m-k}\subseteq G\) . Moreover, we prove that if \(\kappa (G)\ge m-k+1\) , then \(K_{1,m-k}\subseteq G\) . Both these results extend some known results.