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
What is indirection in c?
How do you do dynamic memory allocation in C applications?
What are the Advantages of using macro
i got 75% in all semester am i eligible for your company
What is modeling?
what is the different bitween abap and abap-hr?
What is array of structure in c programming?
Which is an example of a structural homology?
A function can make the value of a variable available to another by a) declaring the variable as global variable b) Passing the variable as a parameter to the second function c) Either of the two methods in (A) and (B) d) binary stream
How many types of arrays are there in c?
If jack lies on Mon, Tue Wed and jill lies on Thursday, Friday and Saturday. If both together tell they lied yesterday. So c the given options and then c cos in the given dates one will be saying the truth and one will be lying. I got Thursday as option because jack is saying the truth he lied yest but jill is lying again as he lies on that day.
Can a local variable be volatile in c?
Calculate 1*2*3*____*n using recursive function??
What are the two types of functions in c?
Why do we use c for the speed of light?