multiplication table

Hi, can someone help me to write a MULTIPLICATION TABLE program, where u input a the out put ashould look like this:

Please enter a number: 4
1 X 4 = 4
2 X 4 = 8
until 10 X 4 =40 number and get a multiplication table of that number.
(could this be at some point considered trolling?)

http://www.cplusplus.com/doc/tutorial/ --> Come on, don't be lazy....!

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#include <iostream>

using namespace std;

int main()
{
int number = 0;
cout <<"Please enter a number: ";
cin >> number;

for (int n = 1; n<=10; n++){
cout <<n <<" x " <<number <<" = " <<(n*number) <<endl; //the given number will be multiplied for 1 to 10
}
system ("PAUSE"); //if you are compiling with windows, otherwise it won't compile
return 0;

Please enter a number: 6
1 x 6 = 6
2 x 6 = 12
3 x 6 = 18
4 x 6 = 24
5 x 6 = 30
6 x 6 = 36
7 x 6 = 42
8 x 6 = 48
9 x 6 = 54
10 x 6 = 60
Last edited on
thanks! :)
Topic archived. No new replies allowed.