Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

Why use int main instead of void main?

1105


What are the 3 types of structures?

1017


What are the features of the c language?

1065


what are # pragma staments?

2029


What are integer variable, floating-point variable and character variable?

1231


How can I invoke another program or command and trap its output?

1078


How is actual parameter different from the formal parameter?

1009


The difference between printf and fprintf is ?

1263


What are the usage of pointer in c?

1179


What is the purpose of 'register' keyword?

1086


What is the -> in c?

994


Is sizeof a keyword in c?

957


Why we write conio h in c?

1011


What do you understand by friend-functions? How are they used?

1192


What is the difference between #include and #include 'file' ?

1037