Q422
What will be the output of the following C++ code? #include using namespace std; int array[10] = 0, 1, 2, 3, 4, 5, 6, 7, 8, 9; void swap(int x, int y) int temp = array[x]; array[x] = array[y]; array[y] = temp; return; void printArray(int size) int i; for (i = 0; i = 0;i--) swap(i, k - 1); permute(k - 1, size); swap(i, k - 1); return; int main() permute(3, 3); return 0;
A.
0 1 2
1 0 2
1 0 2
B.
0 2 1
2 0 1
2 0 1
C.
2 1 0
1 2 0
1 2 0
D.
All of the mentioned
AnswerAnswer: Option D
Solution
Answer: Option D
No explanation is given for this question Let's Discuss on Board