Write the following two functions

Write the following two functions in C++1. void generate(int arr[], int size)to generate a random permutation of the numbers 1 to 10.To generate a random permutation, the function needs to fill a permutation array with the numbers 1 to 10 so that NO two elements in the permutation array have the same contents. To achieve that, your function should do the following:• Create a second array (name this array source) and fill it with numbers from 1 to 10.

• Randomly select an element from the array source

Don't use plagiarized sources. Get Your Custom Essay on
Need an answer from similar question? You have just landed to the most confidential, trustful essay writing service to order the paper from.
Just from $11/Page
Order Now

• Remove the selected element from source and append it to the permutation array.2. void print_array(int arr[], int size)to print out the elements in the permutation array separated by a white space.Write a C++ code that calls the generate and print_arrays functions repeatedly (5 times) to generate five random permutations of the numbers 1 to 10 and display the outcome at the console.