My output double is not accepting more than 6 digits number, what can be the problem? | SoloLearn: Learn to code for FREE!

0

My output double is not accepting more than 6 digits number, what can be the problem?

https://code.sololearn.com/c1ywks87YndC/?ref=app

5/2/2020 1:12:40 PM

AbdallahF

2 Answers

New Answer

+1

Default precesion of float or double data type is 6. To increase the output precesion, set the precesion like cout << setprecision (10) << var; to use fixpoint floating number in output, use cout << fixed << setprecision(15) << var; Play with it, and observe how output changes when you write fixed and not write fixed.

+1

Thanks it worked!