a function to return the length of a string in c
/**
* A PROGRAM THAT RETURNS THE LENGTH OF A STRING FROM THE USER
*/
#include <stdio.h>
/**
* _strlen - takes a string and returns its length
* @i: counter variable
* @*s: the string entered by the user from the terminal
* Return: Length of the string = i
*/
int _strlen(char *s)
{
int i;
for(i = 0; s[i];)
i++;
return(i);
}
/**
* main - start of this program
* @str: string entered by user
* Return: 0 when runs successfully
*/
int main()
{
char str[100];
printf("Enter your stringn");
scanf("%s",str);
printf("%s is %i charactersn", str, _strlen(str));
return 0;
}