#include <stdio.h>

int stringLength( char *str) {
    int length = 0;

    while (str[length] != '\0') {
        length++;
    }

    return length;
}

int main() {
    char sentence[100];

    printf("Enter a string: \n");
    scanf("%s",sentence);

    printf("Length of the string: %d\n", stringLength(sentence));

    return 0;
}

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: