SHARE
TWEET

P1..Calculate length of string

mhrabbi Jul 22nd, 2019 (edited) 66 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include<stdio.h>
  2. int main()
  3. {
  4.     char n[100];
  5.     int i;
  6.  
  7.     printf("Enter String: ");
  8.     scanf("%s",n);
  9.  
  10.     for(i=0; n[i]!='\0'; i++);
  11.     printf("Length %d",i);
  12.  
  13. return 0;
  14.  
  15. }
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
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top