
Lesson 3-3: Formatting Output
56 | Chapter 3
Name __________________________________________ Date _______________________
Section _________________________________________
Use the following program shell for Exercises 1 through 4.
// Program Numbers sends numbers to the output stream in
// specified formats.
#include <iostream>
#include <iomanip>
using namespace std;
int main ()
{
cout << fixed << showpoint;
return 0;
}
Exercise 1: Write a program to print the following numbers right-justified in a column on the
screen. Make the values named constants.
1066 1492 512 1 -23
Exercise 2: Add two statements to your program. Calculate the floating-point result from ...