#include <string.h>
#include <conio.h>
#include <stdio.h>

void main()
{
    int i,j,len=0;
    char str[30];
    clrscr();
    printf("\n Enter a String to Find Length : " );
    gets(str);
    for(i=0; str[i]!='\0'; i++)
    {
        len++;
    }
    printf("\n String Length for %s is :%d ",str,len);
    getch();
}

 OUTPUT:

 Enter a String to Find Length : programming9
 
 String Length for programming9 is :12