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
How do you list files in a directory?
Explain which of the following operators is incorrect and why? ( >=, <=, <>, ==)
What is extern c used for?
What is the difference between pure virtual function and virtual function?
What does the format %10.2 mean when included in a printf statement?
c language supports bitwise operations, why a) 'c' language is system oriented b) 'c' language is problem oriented c) 'c' language is middle level language d) all the above
What are the application of void data type in c?
what is the difference between north western polytechnique university and your applied colleges?? please give ur answers for this. :)
Write an efficient algo and C code to shuffle a pack of cards.. this one was a feedback process until we came up with one with no extra storage.
Explain how can I pad a string to a known length?
What is union and structure?
What is difference between array and structure in c?
Write a program to know whether the input number is an armstrong number.
the question is that what you have been doing all these periods (one year gap)
What is a global variable in c?