Computer Science, asked by arsdeeparshu2, 8 months ago

Stelen ("India to great function will return
length of string​

Answers

Answered by Anonymous
0

Answer:

Length of string in C language

  • int main() { char a[100]; int length;
  • printf("Enter a string to calculate its length\n"); gets(a);
  • length = strlen(a);
  • printf("Length of the string = %d\n", length);
  • return 0; }

Explanation:

// c program to demonstrate

// example of strlen() function.

#include<stdio.h>

#include <string.h>

int main()

{

char ch[]={'g', 'e', 'e', 'k', 's', '\0'};

printf("Length of string is: %d", strlen(ch));

return 0;

}

Similar questions