Write a complete Java/C++ program that includes:
NonZeros functionwhich should create and return an array of integers containing all of the non-zero values in its parameter array A, in the same order that they occur in array A.
2- A main function as well as the NonZeros function. The main function should test NonZeros by creating several arrays, and calling NonZeros with each array. It should print the array it passes to NonZeros as well as the returned array. So for example, when you run your program, your output might look like this (if your NonZeros function is implemented correctly.