SHARE
TWEET

Untitled

a guest Apr 23rd, 2019 62 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include<stdio.h>
  2. int main()
  3. {
  4.     char str[100];
  5.     int words=0,space=0,stop=0,i;
  6.     gets(str);
  7.     for(i=0; i<=str[i]; i++)
  8.     {
  9.         if(str[i]==' ')
  10.         {
  11.             words++;
  12.             space++;
  13.         }
  14.         else if(str[i]=='.')
  15.             stop++;
  16.     }
  17.     printf("Number of Words: %d\n",++words);
  18.     printf("Number of White Spaces: %d\n",space);
  19.     printf("Number of Full Stops: %d\n",stop);
  20.     return 0;
  21.  
  22. }
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