You have not declared the variable array which you have used in printf("%d ", array[i][j]);