networking · beginner · ~15 min
Bound-check a port number.
Implement int is_valid_port(int p) returning 1 if p is a usable TCP/UDP port (1..65535), else 0.
int is_valid_port(int p) {
/* TODO */
return 0;
}
Solve this exercise in the browser editor — compile and run against the test harness, no setup required.