samedi 23 novembre 2019

Why should I write i

cout<<"\n enter elements of first matrix: ";
for(i=0;i<r1;i++)
{
    for(j=0;j<c1;j++)
    {
         cout << "Enter element a" << i + 1 << j + 1 << " : ";
        cin >> a[i][j];
    }
}

why are we writing i<r1 and j<c1 ? and how is the above code working? why is it starting with 0 and how is i<r1? can anyone explain it to me step by step?

Aucun commentaire:

Enregistrer un commentaire