68.6k views
3 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 Mr Shoubs
by
7.0k points

1 Answer

6 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 Gabriel Ilharco
by
5.5k points