67 279
Assignments Done
99,1%
Successfully Done
In November 2018

Answer to Question #39195 in C++ for muse

Question #39195
Write a c++ program to find the sum of 0.123 * 1000 and 0.456 *100
and write the result in three significant digits.
Expert's answer
#include <cstdlib>
#include<iostream>

using namespace std;

int main(int argc, char** argv) {
double sum = 0.123 * 1000 + 0.456 * 100;
cout.setf(ios::fixed);
cout.precision(3);
cout << sum << endl;
return 0;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be first!

Leave a comment

Ask Your question

Submit
Privacy policy Terms and Conditions