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

Write a program to check prime number in c programming?

1047


What is typedf?

1081


What is hashing in c?

1113


Why string is used in c?

962


When should the volatile modifier be used?

1123


Define and explain about ! Operator?

967


Explain the process of converting a Tree into a Binary Tree.

2627


please send me the code for multiplying sparse matrix using c

2135


How can you tell whether two strings are the same?

1222


Explain the advantages and disadvantages of macros.

1046


What is the difference between array and linked list in c?

1101


Can you write the algorithm for Queue?

2046


Differentiate abs() function from fabs() function.

972


Why are all header files not declared in every c program?

1057


the constant value in the case label is followed by a a) semicolon b) colon c) braces d) none of the above

1218