i tried a program to remove common alphabets from character array in c language : void main()
{

 int i, j, k,flag=1;

char key[10], keyword[10];

gets(key);

i=0;

j=0;

while(key[i]!='\0') {
  
 k=0;
   
      while(keyword[k]!='\0') {
         if(key[i]==keyword[k]) {
         i++;
         flag=0;
         break;
      }
      k++;
   }

   if(flag==1) {
   
      keyword[j]=key[i];
      j++;
      i++;
   }

   flag=1;

}

}



Here i tried to copy unique alphabets from array to another array ..means duplicate alphabet should not copied in another array..it shows right output but along with that it shows some garbage values like smiley or something till the length of original input array(i.e.key[])