im trying to write a program that replaces one or more blank spaces with a single blank space. this above code works if u enter 2 blank spaces some where in the string. how do i test for 3 or more blank spaces and then replace that space with a single blank space?Code:main() { int c,d; while((c = getchar()) != EOF) { d = getchar(); if(d == ' ') putchar(c); else{ putchar(c); putchar(d); } } }