#include #include #include using namespace std; int main() { int number {0}; // initialize variable to 0 cout << "Enter a number for the multiplication table: "; cin >> number; if (!cin) { cerr << "Sorry, that wasn't a number.\n"; return EXIT_SUCCESS; } cout << "Multiplication table for " << number << ":\n"; // for loop runs 1 through 100 for (int i = 1; i <= 100; ++i) { cout << setw(2) << number << " x " << setw(2) << i << " = " << setw(3) << number * i << "\n"; } return EXIT_SUCCESS; }