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
Difference between strcpy() and memcpy() function?
Place the #include statement must be written in the program?
Explain threaded binary trees?
Explain modulus operator.
What's the right way to use errno?
Can the curly brackets { } be used to enclose a single line of code?
What is property type c?
What is a header file?
What is difference between union and structure in c?
What are directives in c?
What is getch c?
How can I find the modification date of a file?
What are local static variables? How can you use them?
What is string constants?
What is the default value of local and global variables in c?