1.

What is the output of the program?#include ​

Answer»

#include    using NAMESPACE std;    int arr[10] = {10, 11, 12, 13, 14, 15, 16, 17, 18, 19};    void swap(int p, int Q)    {        int temp = arr[p];        arr[p] = arr[q];        arr[q] = temp;        return;    }    void printArr(int size)    {        int k;        for (k = 0; k < size; k++)            cout << arr[k] << " ";        cout << endl;        return;    }    void Permutation(int N, int size)    {        int k;        if (n == 0)            printArr(size);        else        {            for (k = n - 1; k >= 0; k--)            {                swap(k, n - 1);                Permutation(n - 1, size);                swap(k, n - 1);            }        }        return;    }    int main()    {        Permutation(3, 4);        return 0;    }Explanation:HOPE IT HAS HELPED U



Discussion

No Comment Found