The key problem is s[j]==i. That compares a char of the string to the values 0 to 9 ratter than to char '0' to '9'.
Another is the c is not reset to zero each loop.
Instead of looping 10 times, test if the char is a digit.
Instead of calling j<strlen(s) repeatedly, just test if s[j] == 0
size_t digit_frequency[10] = {0};
for (size_t i=0; s[i]; i++) {
if (isdigit((unsigned char) s[i])) {
// or if (s[i] >= '0' && s[i] <= '9') {
digit_frequency[s[i] - '0']++;
}
}
for (size_t i=0; i<10; i++) {
pritnf("%zu\n", s[i]);
}
Code uses size_t rather than int as a string's length is limited to size_t - which may exceed int in extreme cases. Either work OK work size 100.
isdigit() declared in <ctype.h>
(unsigned char) used as isdigit() expect a value in the (unsigned char) and EOF and a char may be negative.
Various style choices - all function the same.
for (size_t i=0; s[i]; i++) {
for (size_t i=0; s[i] != '\0'; i++) {
for (size_t i=0; s[i] != 0; i++) {
"Given a string consisting of alphabets and digits" is a minor contraction. In C, a string includes the final null character: "A string is a contiguous sequence of characters terminated by and including the first null character" C11 §7.1.1 1. Yet folks often speak colloquially as is the null character was not part of the string.