0

Why the result is 123.766 not 123.7655?

How to print 123.7655? https://code.sololearn.com/cZ4EKCuihYl1/?ref=app

31st Jul 2020, 2:36 AM
sherlockholmes
sherlockholmes - avatar
2 odpowiedzi
+ 3
sherlockholmes C++ only prints 6 digits.Because that's a compiler sense.If you want to do that you must add following lines. #include<iomanip>//header file cout<<setprecision(7)<<number(nums); setprecision() helps to print digits. And add number of digits in setprecision .
31st Jul 2020, 3:19 AM
˜”*°•.˜”*°• Mohan 333 •°*”˜.•°*”˜
˜”*°•.˜”*°• Mohan 333 •°*”˜.•°*”˜ - avatar
0
Thank you case closed
31st Jul 2020, 3:39 AM
sherlockholmes
sherlockholmes - avatar