Write a C program to remove the repeated characters in the
entered expression or in entered characters(i.e) removing
duplicates
Answer Posted / balaji ganesh
#include<stdio.h>
main()
{
char s[50];
int i=0,j;
printf("enter character string:");
while((s[i]=getchar())!='\n')
{
for(j=0;j<i;j++)
if(s[j]==s[i])
i--;
i++;
}
printf("after removing the duplicates the string is:");
for(j=0;j<i;j++)
printf("%c",s[j]);
}
| Is This Answer Correct ? | 10 Yes | 4 No |
Post New Answer View All Answers
Why use int main instead of void main?
What are the 3 types of structures?
What are the features of the c language?
what are # pragma staments?
What are integer variable, floating-point variable and character variable?
How can I invoke another program or command and trap its output?
How is actual parameter different from the formal parameter?
The difference between printf and fprintf is ?
What are the usage of pointer in c?
What is the purpose of 'register' keyword?
What is the -> in c?
Is sizeof a keyword in c?
Why we write conio h in c?
What do you understand by friend-functions? How are they used?
What is the difference between #include and #include 'file' ?