int numAs(const char* s) { int count = 0; for(int i = s; s[i] != '\0'; i++) { if(s[i] == 'a') { count++; } } return count; }