i'm sorry, i'm new to this, i didn't know how.
Code:
#include <stdio.h>
void order_chars( char *c1, char *c2, char *c3)
{
char temp;
printf("%c %c %c\n", c1, c2, c3);
if(c2 < c1 && c2 < c3)
{
temp = *c1;
*c1 = *c2;
*c2 = temp;
}
else if(c3 < c1 && c3 < c2)
{
temp = *c1;
*c1 = *c3;
*c3 = temp;
}
else
;
printf("%c %c %c\n", c1, c2, c3);
if(c2 < c3)
{
temp = *c2;
*c2 = *c3;
*c3 = temp;
}
printf("%c %c %c\n", c1, c2, c3);
}
int main (void)
{
char c1,c2,c3;
printf("Input three unordered characters\n");
scanf("%c%c%c",&c1,&c2,&c3);
printf("%c %c %c\n", c1, c2, c3);
order_chars(&c1,&c2,&c3);
printf("%c %c %c", c1, c2, c3);
return 0;
}