Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdlib.h>
- #include <ctype.h>
- #include <stdio.h>
- int main()
- {
- unsigned long c;
- unsigned long line;
- unsigned long word;
- char ch;
- c = 0;
- line = 0;
- word = 0;
- printf("Please enter text:n");
- while((ch = getchar()) != EOF)
- {
- c ++;
- if (ch == 'n')
- {
- line ++;
- }
- if (ch == ' ' || ch == 'n')
- {
- word ++;
- }
- }
- printf( "%lu %lu %lun", c, word, line );
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement