Hello everyone!
I need a C++ program that stores the results of product table from 1 to 10 in two-dimensional array...
what i did :
#include<iostream.h>
void main()
{
int a[5][2],result;
const int k=1;
for(int f=1;f<=10;f++)
result=k*f;
for(int i=0;i<5;i++)
{
for(int j=0;j<2;j++)
{
a[i][j]=result;
cout<<"a["<<i<<"]["<<j<<"]="<<a[i][j]<<endl;
}
}
}
BUT the output was:
10
10
10
10
10
10
10
10
10
10
I'm pretty sure there's something missing in the code...could u plz help?