Objectives
- Explain which libraries are needed for different purposes
- Use C++ output formatting
string s1 = "Hello"; string s2 = "world"; int x = 5; int y = 37; cout << s1 << " " << s2 << "!\n"; cout << x << " + " << y << " = " << (x + y) << '\n';
double x = 12.348; int n = 15; cout << x << endl; // displays: 12.348 cout << fixed << showpoint << setprecision(2) << x << endl; // displays: 12.35 cout << setw(10) << n << endl; // displays: 8 spaces and 15 cout << x << endl; // displays: 12.348 cout << setfill('0') << setw(7) << n << endl; // displays: 0000015