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

How do you list files in a directory?

1143


Explain which of the following operators is incorrect and why? ( >=, <=, <>, ==)

1031


What is extern c used for?

1062


What is the difference between pure virtual function and virtual function?

1122


What does the format %10.2 mean when included in a printf statement?

1653


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

1049


What are the application of void data type in c?

1191


what is the difference between north western polytechnique university and your applied colleges?? please give ur answers for this. :)

2409


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.

1065


Explain how can I pad a string to a known length?

1193


What is union and structure?

1124


What is difference between array and structure in c?

1190


Write a program to know whether the input number is an armstrong number.

1123


the question is that what you have been doing all these periods (one year gap)

2082


What is a global variable in c?

1006