Advertisement
osmangoni

string length

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