-
What is the output of this program?
#include <iostream>
#include <algorithm>
using namespace std;
int main ()
{
int Numbers[] = {23, 25, 32, 43};
sort (Numbers, Numbers + 4);
do
{
} while ( next_permutation(Numbers, Numbers + 4) );
cout << Numbers[0] << ' ' << Numbers[1] << ' ' << Numbers[2] << ' ' << Numbers[3] << '\n';
return 0;
}
-
- Compilation Error
- 23
- 23 25
- 23 25 32
- 23 25 32 43
Correct Option: E
In this program, We are doing the permutation in the do while loop and then printing last permuted value.