/* * Program to find highest power of 2 <= input. */ #include int main(void) { int input; if (scanf("%d", &input) != 1) { printf("not an integer\n"); return 1; } int power = 0; int two_to_power = 1; while (2 * two_to_power <= input) { power += 1; two_to_power *= 2; } printf("2 to the %d is %d\n", power, two_to_power); return 0; }