cybersecurity · intermediate · ~15 min
Parse and range-check numeric input.
Implement int valid_int_in_range(const char *s, int lo, int hi) returning 1 if s is a valid base-10 integer within [lo, hi], else 0.
#include <stdlib.h>
int valid_int_in_range(const char *s, int lo, int hi) {
/* TODO */
return 0;
}
Solve this exercise in the browser editor — compile and run against the test harness, no setup required.