hi guys im trying to write a code that reads from a text file the values Aij i,j= 1,2,3 for a matrix (3x3)
I'm trying to write a code where the elements are printed as
A[1][1]:1
all the way to
A[3][3] :9
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
#include <iostream>
#include <conio.h>
usingnamespace std;
int main ()
{
int a[3][3] = { {1,2,3}, {4,5,6}, {7,8,9}};
for ( int i = 1; i < 4; i++ )
for ( int j = 1; j < 4; j++ )
{
cout << "a[" << i << "][" << j << "]: ";
cout << a[i][j]<< endl;
}
getch();
return 0;
}
this isn't giving me what i want when i try to run it - please help!