#include <stdio.h>
#include <string.h>
int main() {
char str[] = "Hello, World!";
int len = strlen(str);
printf("Length of the string: %d\n", len);
return 0;
}
#include <stdio.h>
int main() {
char str[] = "Hello, World!";
int len = 0;
while (str[len] != '\0') {
len++;
}
printf("Length of the string: %d\n", len);
return 0;
}
#include <stdio.h>
int strLength(char *str) {
int len = 0;
while (*str != '\0') {
len++;
str++;
}
return len;
}
int main() {
char str[] = "Hello, World!";
int len = strLength(str);
printf("Length of the string: %d\n", len);
return 0;
}