Ampere's circuital law states that line integral of magnetic field around any closed loop is equal to \\\\(\\mu_o\\\\) times the electric current flowing through the cross-section area enclosed by that loop.Mathematically, \\\\(\\oint B.dl = \\mu I\\\\)Let the current flowing in the solenoid having number of turns per unit length \\\\(n\\\\) be \\\\(I\\\\).Magnitude of magnetic field inside the solenoid is \\\\(B\\\\) while at outside is zero.Now \\\\(\\oint_{loop} B.dl = \\int B_{ab}. L + \\int B_{bc}. L' + \\int B_{cd}. L + \\int B_{da} . L'\\\\)The value of first term \\\\(\\int B_{ab}.L = BL\\\\)The second and fourth term are zero because angle between magnetic field and the length loop is \\\\(90^o\\\\).The third term is also zero as the value of magnetic field outside the solenoid is zero.Total current flowing through the loop \\\\(I_{total} = (nL) I \\\\)From Ampere's circuital law, we get \\\\(BL = \\mu_o (nL I)\\\\) \\\\(\\implies\\\\) \\\\(B = \\mu_o nI\\\\)