364,241 views
34 votes
34 votes
Output all combinations of character variables a, b, and c, in the order shown below. If a = 'x', b = 'y', and c = 'z', then the output is: xyz xzy yxz yzx zxy zyx Note: If outputting multiple character variables with one statement, the argument for System.out.print() should start with "" + Your code will be tested in three different programs, with a, b, c assigned with 'x', 'y', 'z', then with '#', '$', '%', then with '1', '2', '3'.

Output all combinations of character variables a, b, and c, in the order shown below-example-1
User Lolo Me
by
3.0k points

1 Answer

15 votes
15 votes

You can find below. We used recursive method to create permutation string.

Output all combinations of character variables a, b, and c, in the order shown below-example-1
User Kyle Ivey
by
3.2k points