// Sample Program using strlen() function
#include<stdio.h>
#include <stdio.h>
#include <string.h>
int main()
{
char name[10];
printf("Enter the String");
scanf("%s",name);
printf("you have Entered %s\n",name);
printf("lenght of string = %d",strlen(name));
return 0;
}
// STRING LENGHT WITHOUT FUNCTION
#include <stdio.h>
int main()
{
char str_buff[20];
int count =0;
printf("Enter your string");
gets(str_buff);
while(str_buff[count]!='\0')
count++;
printf("Lenght of string is %d",count);
return 0;
}
c programming