In this tutorial, We have shared how to remove Consecutive Repeated Characters from string using c programming language. This program will read a string and remove repeated consecutive characters from the string and print new updated string.
Related Articles
/** * Remove consecutive repeated characters from string using c. */ #includeint main() { char str[100]; int i,j,len,len1; /*read string*/ printf("Enter any string: "); gets(str); /*calculating length*/ for(len=0; str[len]!='\0'; len++); /*assign 0 to len1 - length of removed characters*/ len1=0; /*Removing consecutive repeated characters from string*/ for(i=0; i Program Output
First Run: Enter any string: AABBCCDD String after removing characaters: ABCDThe post C program to Remove Consecutive Repeated characters from string appeared first on FreeWebMentor.
This post first appeared on Programming Blog Focused On Web Technologies, please read the originial post: here