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 can you determine the maximum value that a numeric variable can hold?
What is the difference between strcpy() and memcpy() function in c programming?
What are the data types present in c?
What is the importance of c in your views?
how to make a scientific calculater ?
Where does the name "C" come from, anyway?
Can main () be called recursively?
What is the difference between malloc() and calloc() function in c language?
Is a house a mass structure?
what is ur strangth & weekness
why programs in c are running with out #include
Write an algorithm for implementing insertion and deletion operations in a singly linked list using arrays ?
List the difference between a While & Do While loops?
What do you know about the use of bit field?
What is the code in while loop that returns the output of given code?