Ask Question
29 January, 21:00

Output all combinations of character variables a, b, and c, using this ordering abc acb bac bca cab cba So if a x, b-y, and c-z, then the output is: xyz xzy yxz yzx zxy zyx Your code will be tested in three different programs, with a, b, c assigned with 'X, y, z', then with'#. $,'%, then with '1. '23 1 #include 2 using namespace std; 4 int main () 6 char b; 1 test passed char a; All tests passed char c; 10 12 Your solution goes here / cout << endl; return e; 13 14 16 17 18

+3
Answers (1)
  1. 29 January, 23:55
    0
    The solution is to use character variable and assign values and finally print all the combination of values.

    Explanation:

    public class AllCombinations {

    public static void main (String [] args) {

    //Declaring the variables

    char a1;

    char b1;

    char c1;

    //Assigning characters to form combinations

    a1 = 'x';

    b1 = 'y';

    c1 = 'z';

    //Printing the combinations

    System. out. print ("" + a1 + b1 + c1 + "/n " + a1 + c1 + b1 + "/n" + b1 + a1 + c1 + "/n" + b1 + c1 + a1 + "/n " + c1 + a1 + b1 + "/n " + c1 + b1 + a1);

    }

    }
Know the Answer?
Not Sure About the Answer?
Find an answer to your question ✅ “Output all combinations of character variables a, b, and c, using this ordering abc acb bac bca cab cba So if a x, b-y, and c-z, then the ...” in 📘 Computers and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers