cybersecurity · beginner · ~15 min · safe pentest lab
Compute an inclusive range size.
Implement int port_count(int lo, int hi) returning how many ports are in the inclusive range [lo, hi], or 0 if hi < lo.
int port_count(int lo, int hi) {
/* TODO */
return 0;
}
Solve this exercise in the browser editor — compile and run against the test harness, no setup required.