The strlen() function returns the length of the given string. It doesn't count null character '\0'.
#include#include int main(){ char ch[20]={'r', 'o', 'o', 'k', 'i', 'e', 'n', 'e', 'r', 'd', '\0'}; printf("Length of string is: %d",strlen(ch)); return 0; }
Output: