Isomorphism of a product $C_n \times C_m$ of cyclic groups with the cyclic group $C_{mn}$ 
Given that $C_n$ is a cyclic group of order $n$, what conditions must integers $n$ and $m$ satisfy such that the group $C_n \times C_m$ is isomorphic to C$_{mn}$?

So I attempted to investigate a few lower-order cyclic groups to find a pattern. In particular, I looked at $C_2 \times C_3$ and compared it to $C_6$. Here are a couple of diagrams:
$C_2 \times C_3$ - http://escarbille.free.fr/group/?g=6_2b
$C_6$ - http://escarbille.free.fr/group/?g=6_2a
They Cayley tables look pretty different (identity elements are all over the place for $C_2 \times C_3$) so I concluded that they are not isomorphic.
I did the same for $C_2 \times C_4$ and $C_8$:
$C_2 \times C_4$ - http://escarbille.free.fr/group/?g=8_2
$C_8$ - http://escarbille.free.fr/group/?g=8_1
Again, I arrived at the conclusion that the 2 groups are not isomorphic due to their Cayley table structure.
It seems I'm stuck now. Are my conclusions wrong for the examples I examined? If so, how do I find the conditions for the general case of comparing $C_m \times C_n$ with $C_{mn}$?

The correct condition is that $m$ and $n$ are coprime, that is, have no common factors. In particular, this means that $C_2 \times C_3 \cong C_6$. (Sometimes it is hard to compare two multiplication tables by inspection, though it can help identifying two isomorphic groups from their tables by reordering the elements.)
Hint Given two groups $G, H$ and elements $a \in G, b \in H$, the order of element $(a, b)$ is the smallest number, $\text{lcm}(k, l)$ divisible by both the order of $l$ of $a$ and the order $k$ of $b$.

In particular, suppose $G$ and $H$ are cyclic, say $G = C_n$, $H = C_m$. Then, if $a$ and $b$ are generators of $C_n$, $C_m$, respectively, by definition they have respective orders $n, m$ and hence $(a, b) \in C_n \times C_m$ has order  $\text{lcm}(m, n)$.  So, if $m, n$ are coprime, this order is $\text{lcm}(m, n) = mn$. Conversely, if $m, n$ are not coprime, then since any $a \in C_n$ has order $l$ dividing $n$ and any $b \in C_m$ has order $k$ dividing $m$, we have that the generic element $(a, b) \in C_n \times C_m$ has order $\text{lcm}(k, l) \leq \text{lcm}(m, n) < mn$. In particular, no element has order $mn$, so $C_m \times C_n$ is not cyclic.

For example, the elements $1 \in C_2$ and $1 \in C_3$ generate their respective groups, and the powers of $(1, 1) \in C_2 \times C_3$ are
$$(1, 1), (0, 2), (1, 0), (0, 1), (1, 2), (0, 0),$$
so $(1, 1)$ generates all of $C_2 \times C_3$, which is hence isomorphic to $C_6$.
