#include<stdio.h>
#include<string.h>
void main()
{
int i,j=0;
char str[25],str1[25];
clrscr();
printf("Enter the string:");
gets(str);
strcpy(str1,str);
for(i=0;str[i]!='\0';i++)
{
for(j=i+1;str[j]!='\0';j++)
{
if (str1[i] == str[j])
{
str[j]='*';
break;
}
}
}
printf("%s", str);
getch();
}
DownLoad
#include<string.h>
void main()
{
int i,j=0;
char str[25],str1[25];
clrscr();
printf("Enter the string:");
gets(str);
strcpy(str1,str);
for(i=0;str[i]!='\0';i++)
{
for(j=i+1;str[j]!='\0';j++)
{
if (str1[i] == str[j])
{
str[j]='*';
break;
}
}
}
printf("%s", str);
getch();
}
DownLoad
Repeted Character Replace by * in C
Reviewed by Unknown
on
12:23 pm
Rating:
No comments: