setprecision ( 3 ) is used to display the output up to 3 decimal places
cout << fixed << setprecision ( 3 ) << " ln ▁ " << n << " ▁ = ▁ " << lnx << endl ; cout << fixed << setprecision ( 3 ) << " log10 ▁ " << n << " ▁ = ▁ " << logx << endl ; }