SHARE
TWEET

P1.1 Calculate length of string using strlen() Function

mhrabbi Jul 22nd, 2019 70 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include<stdio.h>
  2. #include<string.h>
  3. int main()
  4. {
  5.     char name[100];
  6.     int length;
  7.  
  8.     printf("Enter String: ");
  9.     scanf("%s",name);
  10.  
  11.     length=strlen(name);
  12.     printf("Length of %s is %d",name,length);
  13.  
  14.     return 0;
  15.  
  16. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top