Advertisement
mhrabbi

P1..Calculate length of string

Jul 22nd, 2019
148
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.19 KB | None | 0 0
  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. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement