#include <iostream> using namespace std; int main() { char a[5][5]; int j = 0; for(int i = 0; i < 4; i++) { while(j<4) { if(ji >= 0) { a[i][j] = '1'; j++; } else a[i][j] = ' '; j++; } j = 0; } j = 0; for(int i = 0; i < 4; i++) { while(j<4) { cout << a[i][j]; j++; } j = 0; cout << "\n"; } return 0; } The code prints nothing and does not return, I suspect that it is stuck in a loop, but I can not find where.