Answer to Question #292214 in C for sage

Question #292214

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




1
Expert's answer
2022-01-31T04:32:21-0500
#include <stdio.h>

int main() {
    char a = 'x';
    char b = 'y';
    char c = 'z';
    printf("%c%c%c ", a, b, c);
    printf("%c%c%c ", a, c, b);
    printf("%c%c%c ", b, a, c);
    printf("%c%c%c ", b, c, a);
    printf("%c%c%c ", c, a, b);
    printf("%c%c%c ", c, b, a);
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS