Find Length of String Using Library Function

February 14, 2025 No Comments » Hits : 559





Find Length of String Using Library Function

#include<stdio.h>
#include<conio.h>
#include<string.h>
void main()
{
char str[100];
int len;
printf("\nEnter the String : ");
gets(str);
len = strlen(str);
printf("\nLength of Given String : %d",len);
getch();
}

Explain me ?

  1. strlen function is Used to Compute Length of String
  2. strlen function is included in Header File : string.h

Functions Required :

Incoming search terms: