( sorry I forgot to make it public) How do I stop the execution of the program? In the program given below | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

( sorry I forgot to make it public) How do I stop the execution of the program? In the program given below

this is a program to convert number with base 10 after the decimal part (0.xyz) to base 8. the program runs well but it doesn't stop when I input the value 0.53125 the output i want it 0.42 but the output i get is 0.420202 what changes should I make? link of the program http://www.sololearn.com/app/cplusplus/playground/c5l1398xrTor/

4th Nov 2016, 1:46 PM
Infinity
Infinity - avatar
1 Answer
0
I am unable get to the link. But you can put these lines before displaying the value.Make sure you have put "iomanip" header file. cout.setf(ios::fixed); cout.precision(2); It sets your decimal part to a precision of 2. I hope it works.😃
4th Nov 2016, 5:05 PM
kamal joshi
kamal joshi - avatar