networking · beginner · ~15 min

Port within scan range?

Bound a port to a scan window.

Challenge

Implement int port_in_range(int port, int lo, int hi) returning 1 if lo <= port <= hi, else 0.

Starter code

int port_in_range(int port, int lo, int hi) {
    /* TODO */
    return 0;
}

Solve this exercise in the browser editor — compile and run against the test harness, no setup required.