Carbon nanotubes (CNTs) are considered promising candidates for biomolecular confinement, including DNA encapsulation for gene delivery. Threshold values of diameters have been reported for double-stranded DNA (dsDNA) encapsulation inside CNTs. We have performed all-atom molecular dynamics (MD) simulations of dsDNAs confined inside single-walled CNTs (SWCNTs) at the physiologically relevant temperature of 300 K. We found that the dsDNA can be confined without being denatured only when the diameter of the SWCNT exceeds a threshold value. Below this threshold diameter, the dsDNA gets denatured and melts even at the temperature of 300 K. Our simulations using SWCNTs with chirality indices (20,20) to (30,30) at 300 K found the critical diameter to be 3.25 nm (corresponding to (24,24) chirality). Analyses of the hydrogen bonds (H-bonds), Van der Walls (VdW) energy, and other inter-base interactions show drastic reduction in the number of H-bonds, VdW energy, and electrostatic energies between the bases of dsDNA when it is confined in narrower SWCNTs (up to diameter of 3.12 nm). On the other hand, the higher interaction energy between the dsDNA and the SWCNT surface in narrower SWCNTs assists in the melting of the dsDNA. Electrostatic mapping and hydration status analyses show that the dsDNA is not adequately hydrated and the counter ion distribution is not uniform below the critical diameter of the SWCNT. As properly hydrated counter ions provide stability to the dsDNA, we infer that the inappropriate hydration of counter ions and their non-uniform distribution around the dsDNA cause the melting of the dsDNA inside SWCNTs of diameter below the critical value of 3.25 nm. For confined dsDNAs that do not get denatured, we computed their elastic properties. The persistence length of dsDNA was found to increase by a factor of about two and the torsional stiffness by a factor of 1.5 for confinement inside SWCNTs of diameters up to 3.79 nm, the stretch modulus also following nearly the same trend. Interestingly, for higher diameters of SWCNT, 3.79 nm and above, the dsDNA becomes more flexible, demonstrating that the mechanical properties of the dsDNA under cylindrical confinement depend non-monotonically on the confinement diameter.