adplus-dvertising
frame-decoration

Question

What is the output of this program?
    #include <iostream>
    #include <algorithm>
    using namespace std;
    int main () 
    {
        int myints[] = {1, 2, 3};
        sort (myints, myints + 3);
        do 
        {
        } while ( next_permutation(myints, myints + 3) );
        cout << myints[0] << ' ' << myints[1] << ' ' << myints[2] << '\n';
        return 0;
    }

a.

1 2 3

b.

3 2 1

c.

2 1 3

d.

1 3 2

Answer: (a).1 2 3

Engage with the Community - Add Your Comment

Confused About the Answer? Ask for Details Here.

Know the Explanation? Add it Here.

Q. What is the output of this program?