Program to tell which if any of three numbers is in the middle
Well, first of all, consider adopting one of the myriad common indentation-styles and use it consistently.
Doing so will make your code far easier to read and write.
You should test whether you really got three numbers.
Currently, you don't, which leads to UB.
If in doubt, sort.

That eliminates an astonishing number of problems.
You aren't using anything from &lt;math.h&gt;, so don't include it.
exit(0); and return 0; have nearly the same effect when done in main.
The only differences are when main is called recursively, and we won't do such an abomination outside the IOCCC. (Or if we change to a different language, like C++, but who would do that?)




#include &lt;stdlib.h&gt;
#include &lt;stdio.h&gt;

typedef struct namednumber {int num; char name; } namednumber;

static int comp_namednumber(const void* pa, const void* pb) {
    int a = ((namednumber*)pa)-&gt;num,
        b = ((namednumber*)pb)-&gt;num;
    return (a &gt; b) - (a &lt; b);
}

int main() { // No need for void in the parameter-list, this is a definition
    int a, b, c;
    printf("Please enter three numbers:\n");
    if(3 != scanf("%i %i %i", &amp;a, &amp;b, &amp;c)) {
        printf("You didn't enter three numbers. Aborting.\n");
        return EXIT_FAILURE;
    }

    if(a == b || b == c || c == a) {
        printf("There is no gap.");
        return 0;
    }

    namednumber data[] = {{a,'a'},{b,'b'},{c,'c'}};
    qsort(data, 3, sizeof *data, comp_namednumber);
    printf("%c is between %c and %c\n", data[1].name, data[0].name, data[2].name);

    return 0; // This line is implicit in C99+
}


Actually, getting out qsort is severe overkill, so here with a standard sorting-network:

#include &lt;stdlib.h&gt;
#include &lt;stdio.h&gt;

static void sort2(int* a, char* na, int* b, char* nb) {
    if(*a &lt; *b) return;
    int t = *a;
    *a = *b;
    *b = t;
    char nt = *na;
    *na = *nb;
    *nb = nt;
}

int main() {
    int a, b, c;
    printf("Please enter three numbers:\n");
    if(3 != scanf("%i %i %i", &amp;a, &amp;b, &amp;c)) {
        printf("You didn't enter three numbers. Aborting.\n");
        return EXIT_FAILURE;
    }

    if(a == b || b == c || c == a) {
        printf("There is no gap.");
        return 0;
    }

    char na = 'a', nb = 'b', nc = 'c';
    sort2(&amp;a, &amp;na, &amp;b, &amp;nb);
    sort2(&amp;a, &amp;na, &amp;c, &amp;nc);
    sort2(&amp;b, &amp;nb, &amp;c, &amp;nc);
    printf("%c is between %c and %c\n", nb, na, nc);
}