Need to write a C Program to remove repeated characters adjacent to each other <p>I need to remove only the repeated characters that are adjacent to each other. </p> <p>Example: if the input is <code>"heeellooo wooorllldd"</code>, the output should be <code>"helo world"</code>. The output I am currently getting is <code>"helo wrd"</code>.</p> <p>This is the code i have.</p> <pre><code>#include &lt;stdio.h&gt; #include &lt;string.h&gt; main() { char str[]="heeello wooorld"; redundant(str); } void redundant(char *str) { int check=0; int i,j; char ch; while(str[check]) { ch = str[check]; i = j = check + 1; while(str[i]) { if(str[i] != ch) { str[j] = str[i]; j++; } i++; } str[j]='\0'; check++; } printf("String after removing duplicates : %s\n",str); } </code></pre>