networking · beginner · ~15 min
Bucket a status into its class.
Implement int status_class(int code) returning the leading digit of an HTTP status (e.g. 404 -> 4, 200 -> 2). Return 0 for codes outside 100..599.
int status_class(int code) {
/* TODO */
return 0;
}
Solve this exercise in the browser editor — compile and run against the test harness, no setup required.