/* * Program to print three integers in ascending order. */ #include int main(void) { int x, y, z, temp; printf("enter three integers:\n"); if (scanf("%d %d %d", &x, &y, &z) != 3) { printf("invalid input\n"); return 1; } printf("input %d %d %d\n", x, y, z); if (x > y) { temp = x; x = y; y = temp; } if (x > z) { temp = x; x = z; z = temp; } if (y > z) { temp = y; y = z; z = temp; } printf("in order %d %d %d\n", x, y, z); return 0; }