Advertisement
mhpias2

string length

Dec 7th, 2019
660
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.20 KB | None | 0 0
  1.  
  2. #include<stdio.h>
  3. int main()
  4. {
  5.     char st[20];
  6.     gets(st);
  7.     int i,length=0;
  8.     for(i=0;st[i]!='\0';i++)
  9.     {
  10.         length++;
  11.     }
  12.     printf("Length= %d\n",length);
  13.     return 0;
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement