-
What is the output of this program?
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
void show(const vector<int>& Data)
{
for (size_t k = 0; k < Data.size(); ++k)
{
cout << Data[i] << ' ';
}
cout << endl;
}
int main()
{
vector<int> Data;
Data.push_back(2);
Data.push_back(6);
Data.push_back(6);
sort(Data.begin(), Data.end());
show(Data);
while(next_permutation(Data.begin(), Data.end()))
show(Data);
return 0;
}
-
- 2 6 6
- 6 2 6
- 6 6 2
- All of above
- None of these
- 2 6 6
Correct Option: D
In this program, We are finding the permutation for the given value.