Ad Code

Responsive Advertisement

C program to Remove duplicate Character(Case insensitive)

 

Removing Duplicate Characters Using C program(Case Insensitive)

removing duplicate characters from the string


Removing duplicate character or repeated character from the string (Case Sensitive):

C Program:


Output 1:

Removing Duplicate Characters output


Output 2:

Removing Duplicate Characters output


From the above program,
ü The above lines used to compare the characters in the string one by one, when the repeated character comes then its value is assigned to '0'(a[j]='0').
ü a[i]!='  ', this condition is used to not remove the repeated blank space from the string.
ü tolower() is used to convert the uppercase letters to lowercase letters for comparing. Thus it provides the case insensitive operation for removing the repeated characters.
ü The above lines used to print the final string without '0' value assigned to the repeated character.
ü So this avoid printing CcoLllEge as C0oL00Eg0.


Post a Comment

0 Comments

Close Menu