Confusion regarding q10 mcq

Q10. Algorithms STL#10
Given the following code snippet :

string s = “bca”;

do {
cout << s << ’ ';
} while(next_permutation(s.begin(), s.end()));

cout << s;
What is the output of the given code?

I thought next_permutation gives bigger outputs then how is bca cab cba abc the next answer

@Sayon-Palit-2873308702757758 read the following documentation http://www.cplusplus.com/reference/algorithm/next_permutation/ everything will become clear, If you have any further doubts let me know.