Question

1 2.1 3.2: Outputting all combinations. ACTIVITY 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 y then with # S, % then with 1, 2, 1 #include <iostream> 2 using namespace std; 4 int mainO 5 char a; 6 char b; 7 char c; 9 a=x; 10 b y 12 13 /* Your solution goes here 14 15 cout<s endl; 16 17 18 return 0;please help

0 0
Add a comment Improve this question Transcribed image text
Answer #1
#include <iostream>

using namespace std;

int main() {
   char a;    
   char b;
   char c;
   
   a = 'x';
   b = 'y';
   c = 'z';
   
   cout << a<<b<<c<< " " << a<<c<<b << " " << b<<a<<c << " " << b<<c<<a << " " << c<<a<<b << " " << c<<b<<a;
   
   cout << endl;
   
   return 0;
}
Add a comment
Know the answer?
Add Answer to:
please help 1 2.1 3.2: Outputting all combinations. ACTIVITY Output all combinations of character variables a,...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT