<p>I need to get the number of digits containing the number 1. I know in java I can take the input as a <code>String</code> and use <code>charAt</code>, but I understand there is no implicit String function in C. How can I accomplish this?</p>

Division and modulus are your friends.
```
```
#include "stdio.h"

int main(){
    int digits[] = {0,0,0,0,0,0,0,0,0,0};
    int i = 11031;

    while(i > 0){
        digits[i % 10]++;
        i = i / 10;
    }

    printf("There are %d ones.\n", digits[1]);
}
```
```