I have been trying to write a c++ program for doing the addition of 2 matrices and this is the code i have written. But i keep having the error saying "Process returned -1073741819 (0xC0000005)" Can you please help me find my error?
int main()
{
float a[3][3],b[3][3],c[3][3];
int l,k;
cout<<"tell me the nr of lines in the vectors"<<endl;
cin>>l;
cout<<"tell me the nr of columns in the vectors"<<endl;
cin>>k;
for(int i=1;i<=l;i++){
for(int j=1;j<=k;j++){
cout<<"A["<<i<<"]"<<"["<<j<<"]= ";
cin>>a[i][j];
}
}
for(int i=1;i<=l;i++){
for(int j=1;j<=k;j++){
cout<<"B["<<i<<"]"<<"["<<j<<"]= ";
cin>>b[i][j];
}
}
for(int i=1; i<=l;i++){
for(int j=1;j<=k;i++){
c[i][j]=a[i][j]+b[i][j];
}
}
cout<<"the sum of matrices A & B is;"<<endl;
/* i have also added this code here instead of the following loop just to see if there was a problem with the addition procedure or displayin the results;
cout<<c[i][j]; */
for(int i=1;i<=l;i++){
for(int j=1;j<=k;j++){
cout<<c[i][j];
}
}
return 0;
}