you used a void type array how did it print in main without returning it in main .
this is my code.
The code didnt run in vscode
arrays are passed by reference
so any changes you have done in function will also reflect in main()
hence no need to return array from function