[URI Online Judge] – 1078 – Multiplication Table

Read an integer N (2 < N < 1000). Print the multiplication table of N.
1 x N = N      2 x N = 2N        …       10 x N = 10N

Input

The input is an integer N (1 < N < 1000).

Output

Print the multiplication table of N. like the following example.

Sample Input Sample Output
140 1 x 140 = 140
2 x 140 = 280
3 x 140 = 420
4 x 140 = 560
5 x 140 = 700
6 x 140 = 840
7 x 140 = 980
8 x 140 = 1120
9 x 140 = 1260
10 x 140 = 1400

Solution:

#include <iostream>
using namespace std;
int main(){
 int n, i;
 cin >> n;
 for (i = 1; i <= 10; i++)
 cout << i << " x " << n << " = " << i * n << endl;
 return 0;
}
Advertisements

One thought on “[URI Online Judge] – 1078 – Multiplication Table

  1. It’s actually a great and useful piece of information. I’m glad that you simply
    shared this helpful information with us. Please stay us informed like this.
    Thank you for sharing.

    Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s