About us

C Program to find length of a string

C program to find the length of a string



c-program-length-string


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

void main()
{
char s[20];
int n;
clrscr();
printf("enter any sring\n");
gets(s);
n=strlen(s);
printf("%d",n);
getch();
}

OUTPUT

enter any string
HELP
4


------------------------------------------------------------------------------------------------------------


You can also visit:-