Write a program to calculate length of string using standard library function.

C File =>

/* Write a program to calculate length of string using standard library function. */


#include<stdio.h>
#include<string.h>
int main() 

{
   char s[30];
   printf("\n Enter String : ");
   scanf("%s",s);
   printf("\n Length of string is : %d",strlen(s));
   return 0;
}

Comments

Popular posts from this blog

Write a program to allocate memory dynamically for n integers. Accept the elements and calculate their sum and average

C program to accept names of n cities and search for city named “Pune”.