Advertisement
lnsee96

C

Jul 31st, 2016
63
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. { if (c=' ')
  10. {
  11. printf("value of d is %d",((d=getchar())!=EOF));
  12. if (d=' ')
  13. {
  14. putchar(c);
  15. }
  16. }
  17. else
  18. putchar(c);
  19. }
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement