# Thread: C++ Multiplication Table Generator

1. ## C++ Multiplication Table Generator

Hi,

I am currently taking C++ classes, and I have been given a simple (erm...) task of creating a C++ application that takes one input which is a number to one-decimal point e.g. 1.8, 1.9, 2.0, 2.1!

A user enters a one decimal point number between 0 and 20, and the app uses a loop to create a table up to that number in the format (if a user enters 1.3 then) -:

____ 1.0 | 1.1 | 1.2 | 1.3

1.0__1.0___1.1__ 1.2___1.3
1.1__1.1___1.21_ 1.32__1.43
1.2__1.2___1.32__1.44__1.56
1.3__1.3___1.43__1.56__1.69

(I had to use underscores to align the table because double spaes get removed in my post!)

I need to hand this in, and i've been burning my brain for hours!!!

I've currently got this going:

Code:
```#include <iostream>
#include <string>

using namespace std;

int main()
{
double MAX = 20.00;

cout << "Please enter scale of the multiplication table..." << endl;
cin >> MAX;

for(double i = 0.00; i < MAX; i = i + 0.1)
{
cout << i << "\t";
};

return 0;
}```
VD

2. take a look at the table you generated and ask yourself how did I get each of these values. Then look in your textbook/tutorial for the topic of multidimensional arrays. Briefly, multidimensional arrays can be used to create tables. Nested loops play a prominent role in creating and manipulating values in the multidimensional array. Each "cell" in the array is accessed using a two indexes, one representing a row and the other representing a column. Then note that if row or column index is 0 that these values in your table are treated differently thatn all the other values in your table.

3. ## Re: C++ Multiplication Table Generator

Originally posted by Visual Develope
(I had to use underscores to align the table because double spaes get removed in my post!)
Since the code tag uses a monospaced font, I believe it will also deal with that kind of formatting.

4. ## Re: Re: C++ Multiplication Table Generator

Originally posted by Mario

Since the code tag uses a monospaced font, I believe it will also deal with that kind of formatting.
Code:
`That       is           so          True!`

5. Code:
`The only thing i dont like about code tags is if you go on and type lots and lots and lots and lots and lots of words, it will make the scroll bar apear at the bottom, making it hard for people with lower resolutions to read it,  SEE WHAT I MEAN?`