cybersecurity · beginner · ~15 min
Tally format-control characters.
Implement int count_percent(const char *s) returning the number of '%' characters — a quick risk indicator for a string about to be used as a format.
int count_percent(const char *s) {
/* TODO */
return 0;
}
Solve this exercise in the browser editor — compile and run against the test harness, no setup required.