i want to write a multiplication table that out put in the following format
1 2 3 4
1 x 1 = 1
1 x 2 = 2
...
9 x 9 = 81
below is what i have written so far but its giving me errors, if i declare the variables outside the loop (i think that's what am supposed to do) it compiles but gives me wrong result.
#include <iostream>
usingnamespace std;
int main () {
int i=1; //so that second for loop can access it.
for(i ;i<12;i++);
{
for(int n =1;n<=12;n++)
{
int result= i*n;
cout <<i<<"*"<<n<<"=" <<result<< '\n';
}
}
}