Advertisement
lnsee96

C

Jul 31st, 2016
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. /*Write a program to copy its input to its output, replacing each string of one or more blanks by a single blank*/
  4.  
  5. main()
  6. {
  7. int c,d;
  8. while ((c=getchar())!=EOF)
  9. {
  10. if (c=' ')
  11. {
  12. printf("value of d is %d",((d=getchar())!=EOF));
  13. if (d=' ')
  14. {
  15. putchar(c);
  16. }
  17. }
  18. else
  19. putchar(c);
  20. }
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement