First of all the syntax of the syntax of your custom functiin must be void initilization (int arr[][cols],int n);
Also, the reason for that output is because you constant n=9 and your array has max elements(columns) of 5. This amounts to diplaying other content in memory which are not in your array's scope.