Code:
#include <stdio.h>
int main (void)
{
int a, b, c, low, med, high;
printf("***SORT THE NUMBER***\n");
// ask user for a, b, c
printf(" Enter a:\n ");
scanf("%d", &a);
printf(" Enter b:\n");
scanf("%d", &b);
printf(" Enter c:\n");
scanf("%d", &c);
a = high;
b = med;
c = low;
if (a<c<b)
b = high;
c = med;
a = low;
if (c<a<b)
c = low;
a = med;
b = high;
c = high;
b = low;
a = med;
printf("the sorted numbers are %d, %d, %d\n", a, b, c);
return 0;
}
when i compile it, and input the values, like a=4 b 5 c=2
i get 134514169, -1218548731, -1217273868
how do I make the out put as (2 4 5) ?
what am i doing wrong?