Enter your email address:


Monday, September 2, 2013

Home » , » Code for duplicate s removal

Code for duplicate s removal

Questions: Top-30-c-programs-asked-in-interview_6304.html

29. Code for duplicate' s removal,by Amit Aru.
#include
#include
void main()
{
int i,j,k=0,co unt[300]={ 0};
char ch,str[100 0],str1[10 00];
clrscr();
printf("\n Enter the string to remove duplicasy\ n:");
gets(str);
for (i=0;str[i ]!='\0';i+ +)
{
ch=str[i];
count['']=0; / * U can use other delimiter inplace of space''here,just put that char inside'',for ex: count['A']=0 ; if u dnt want any delimiter, just remove this line.*/

if(count[c h])
continue;
else
{
str1[k++]= ch;
count[ch]= 1;
}
}
puts(str1) ;
getch();
}

Share this games :

0 comments:

Post a Comment

Related Posts