C++ examples for File Stream:cout
Line Up Columns of Numbers
#include <iostream> using namespace std; int main()/*from www .ja va 2 s . c o m*/ { cout << "Root | Square | Cube\n"; for(int i = 1; i < 11; ++i) { cout.width(4); cout << i << " |"; cout.width(7); cout << i * i << " |"; cout.width(8); cout << i * i * i; cout << endl; } return 0; }