0

How nested for loop working here?

#include <iostream> using namespace std; int main() int myarr[3][2]={{5,7},{9,4},{10,12}}; for(int i=0;i<3;i++) for(int j=0;j<2;j++) { cout<<"array position ["<<i<<"]["<<j"]<<myarr[i][j];} after the excution of the first iteration of first for loop the second loop excute completely until become false, then the loop goes to the first , then the second loop still excuting after becoming false.

5th Aug 2017, 10:56 AM
navid
3 Respostas
+ 2
the 2 loop is executing because the 1 for loop is running. the 2 loop will stop executing until the first become false
5th Aug 2017, 11:15 AM
Damon Keane
+ 2
😉
5th Aug 2017, 7:09 PM
Damon Keane
+ 1
thanks bro .
5th Aug 2017, 6:38 PM
navid