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
Write a program to check prime number in c programming?
What is typedf?
What is hashing in c?
Why string is used in c?
When should the volatile modifier be used?
Define and explain about ! Operator?
Explain the process of converting a Tree into a Binary Tree.
please send me the code for multiplying sparse matrix using c
How can you tell whether two strings are the same?
Explain the advantages and disadvantages of macros.
What is the difference between array and linked list in c?
Can you write the algorithm for Queue?
Differentiate abs() function from fabs() function.
Why are all header files not declared in every c program?
the constant value in the case label is followed by a a) semicolon b) colon c) braces d) none of the above