0% found this document useful (0 votes)
5 views2 pages

C++ Multiplication Table Code

This C++ program asks the user to input an integer and then prints out its multiplication table from 1 to 12. It then prints a 9x9 multiplication table with the numbers 1 through 9 along the left side and top. For each inner number, it calculates and displays the product of the outer and inner numbers with tabs between.

Uploaded by

azam
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views2 pages

C++ Multiplication Table Code

This C++ program asks the user to input an integer and then prints out its multiplication table from 1 to 12. It then prints a 9x9 multiplication table with the numbers 1 through 9 along the left side and top. For each inner number, it calculates and displays the product of the outer and inner numbers with tabs between.

Uploaded by

azam
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

#include <iostream>

using namespace std;

int main ()

int n;

cout << "Enter an integer: ";

cin >> n;

for (int i = 1; i <= 12; ++i) {

cout << n << " * " << i << " = " << n*i << endl;

return 0;

#include<iostream>
using namespace std;

int main(void)
{
cout << "A multiplication table:" << endl
<< " 1\t2\t3\t4\t5\t6\t7\t8\t9" << endl
<< "" << endl;
for(int c = 1; c < 10; c++)
{
cout << c << "| ";
for(int i = 1; i < 10; i++)
{
cout << i * c << '\t';
}
cout << endl;
}
return 0;
}

You might also like