I can't find out which character has the middle ASCII value between the 3... I can solve the smallest and biggest but im having some issues with the middle one... pls help!
Code:#include <stdio.h> int main(){ char a,b,c,big,small,mid; printf ("Enter 3 letters:\n"); scanf ("%c %c %c", &a,&b,&c); printf ("You entered: %c %c %c \n\n",a,b,c); if (a<65 || (a>90 && a<97) || a>122){ printf ("Error"); return 0; } else if (b<65 || (b>90 && b<97) || b>122){ printf ("Error"); return 0; } else if (c<65 || (c>90 && c<97) || c>122){ printf ("Error"); return 0; } /* printout in alphabetic order */ big = (a>b?(a>c?a:c):b>c?b:c); small = (a<b?(a<c?a:c):b<c?b:c); /*mid = PLS_HELP_ME_OUT_HERE;*/ printf ("%c %c %c", small, mid, big); return 0; }



1Likes
LinkBack URL
About LinkBacks


