1#include <stdio.h>
2// function for string length
3int string_length(char str[])
4{
5 int i;
6 // you can use while loop
7 for( i = 0; str[i] != '\0';i++);
8 return i;
9}
10int main()
11{
12 // declaring character array
13 char your_name[20]; // you can change the maximum size of string
14 printf("Type you full Name : ");
15 // taking input from user
16 gets(your_name);
17 // using string length function
18 int length = string_length(your_name);
19 // printing string length
20 printf("\nLength of your name (%s) is : %d \n\n",your_name,length);
21
22}
23