Reason : The magnetic field inside the solenoid is uniform.
$\mathrm{B}=\frac{\mu_{0}}{4 \pi}(2 \pi \mathrm{ni})[\sin \alpha+\sin \beta]$
where $\mathrm{n}=\mathrm{no.}$ of turns per unit length
$=\mathrm{N} / \mathrm{l}$
Thus it is clear that mangetic field is independent of length and cross sectional area.
Also the magnetic field with in the solenoid is uniform and parallel to the axis of the solenoid.


