fork download
#include <stdio.h>

int nearest(int x)
{
    #define decide(a, b) if (x <= (a + b) / 2) return a

    decide( 98, 100);
    decide(100, 198);
    decide(198, 200);
    decide(200, 250);
    decide(250, 298);
    return 298;

    #undef decide
}

int main(void)
{
    printf("%d -> %d\n", 50, nearest(50));
    printf("%d -> %d\n", 195, nearest(195));

    return 0;
}
Success #stdin #stdout 0s 4476KB
stdin
Standard input is empty
stdout
50 -> 98
195 -> 198