Hello,
Code:#include<stdio.h> #define x 'a' int main() { int c,y; y=x; while((c=getchar())!=EOF) { if(c==' ') { if(y!=' ') putchar(c); } else putchar(c); y=c; } return 0; }
In the above code in 2nd line why the compiler shows error if we use ' ' in stead of 'a', and please let me know the below lines
if(y!=' ') putchar(c);
how can these lines replace multi spaces by a single space.
what is y = c;