#include#include using namespace std; int main() { cout << setw(10) << "Name" << setw(10) << "Age" << endl; cout << setw(10) << "John" << setw(10) << "25" << endl; cout << setw(10) << "Alice" << setw(10) << "30" << endl; return 0; }
#includeThis code sets the width of the first column to 3 characters and the second column to 5 characters. It prints the first 10 square numbers in a table format. These code examples belong to the C++ Standard Library, which is a collection of packages that provide various implementations for frequently used algorithms, data structures, input/output streams, and other components for developing C++ programs.#include using namespace std; int main() { for(int i = 1; i <= 10; i++) { cout << setw(3) << i << setw(5) << i * i << endl; } return 0; }