Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <iomanip>
- using namespace std;
- int main()
- {
- double num = 123.45;
- double num2 = 123.4567;
- cout << fixed << setprecision(2) << num << endl << num2 << endl;
- return 0;
- }
- // output was:
- //123.45
- //123.46
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement