We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
OK, I got it. There is problem of precision in using cin and cout.
So, I would like to know two things :
(1) Is only cout creating problem, or both cin & cout?
What I mean by this, is if cin is giving correct input value to variable with correct precision or not ?
(2) How to make cout give correct precision (if cin is also responsible, then how to use both of them )?
I would like to know a uniform way (if possible), which works with every floating point value.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Basic Data Types
You are viewing a single comment's thread. Return to all comments →
OK, I got it. There is problem of precision in using cin and cout.
So, I would like to know two things :
(1) Is only cout creating problem, or both cin & cout? What I mean by this, is if cin is giving correct input value to variable with correct precision or not ?
(2) How to make cout give correct precision (if cin is also responsible, then how to use both of them )? I would like to know a uniform way (if possible), which works with every floating point value.