Facebook Google Plus YouTube

C program to find length of string without build in function.

Length of string without build in function.

 

#include <stdio.h>
#include<string.h>
int main()
{
char s[]="Learn and share blog";
int count;
for(count = 0; s[count] != '\0'; count++);
printf("String Length  : %d\n", count);
return 0;
}

output:

String Length : 20

Leave a Reply

%d bloggers like this: