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.
3 Antworten
+ 2
the 2 loop is executing because the 1 for loop is running.
the 2 loop will stop executing until the first become false
+ 2
😉
+ 1
thanks bro .