Hello,
I am writing a very simple program to print out multiplication tables. (I always did stink at maths).
I think I have it written correctly but I get unexpected out put:
Code:
#include <iostream>
using namespace std;
int multiple;
int main()
{
cout << "enter multiple: ";
cin >> multiple;
for (int i = 1 ; i < 12 ; i++)
{
cout << i << " x " << multiple << i*multiple << endl;
}
return 0;
}
if I enter 8 then I get 88 as first output, then 816 and so on with an extra 8 at the start. This is the same with any other table.
This will be something so basic I'll feel stupid but it's good to learn,
thanks in advance