Print the second row of data

Listing 7 prints the two values in the second row according to the same format specifications.

  //Print the second row.
  cout << setw(10) << setprecision(1) 
                        << fixed << 12.78;
  cout << setw(12) << setprecision(3) 
              << fixed << 3.14159 << endl;
  return 0;
}//end main

Listing 7

The screen output is shown in Figure 1.

       1.5       2.200
      12.8       3.142

Figure 1