I am confused by getting the different results after executing the same loops after one another. The first loop Increments the different way and second is completely different.
**Results:**
1 , 1
1 , 2
1 , 3
2 , 1
2 , 2
2 , 3
3 , 1
3 , 2
3 , 3
Code:
#include <iostream>
using namespace std;
int main()
{
for(int outerval {1}; outerval <= 3; outerval++)
for(int innerval {1}; innerval <= 3; innerval++)
cout << outerval << " , " << innerval << '\n';
return 0;
}
Aucun commentaire:
Enregistrer un commentaire