double problems | Sololearn: Learn to code for FREE!

+2

double problems

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

7/17/2017 5:54:05 PM

Bryan

1 Answer

New Answer

+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; }