New course! Every coder should learn Generative AI!
Try a free lesson0
Help me in c++,
so in this code it actually gives me value by rounding but I don't want to get rounded number https://code.sololearn.com/cmt0snjUG0JD/?ref=app
6 Answers
+ 1
thank u so much for u r time
0
it should give 1.857142
but it gives 1.857143
actual value is 1.857142857142857
0
i want number upto 6 decimal places without rounding off.how would i do that?
is there any method?
0
int a=13;
double t;
t=int(a*1000000/double(7));
t=t/double(1000000);
cout<<t;
this printing 1.85714 only
0
I think there is no difference between the above 2 code and they are printing 1.85714 only
maybe I am wrong
0
can u please post the full code?