Monday, September 17, 2012

Code# 64:C Program To Find Length of String

| |

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

main()
{
   char a[100];
   int length;

   printf("Enter a string to calculate it's length\n");
   gets(a);

   length = strlen(a);

   printf("Length of entered string is = %d\n",length);

   return 0;
}
Output:
Enter a string to calculate it's length
c programming
Length of entered string is =13

0 comments:

Post a Comment

Powered by Blogger.