+ 2

double problems

In the following code how can I get the output 5.00; https://code.sololearn.com/cVyLIS7sJ88Y/#cpp

17th Jul 2017, 5:54 PM
Bryan
1 Resposta
+ 16
// Try this : #include <iostream> #include <iomanip> using namespace std; int main() { double d=4.55; double e=0.45; cout<<fixed<<setprecision(2)<<d+e; return 0; }
17th Jul 2017, 6:11 PM
Dev
Dev - avatar