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 / sowjanya

void main()
{
int rep=0;
char ch,str[50];
printf("enter the string:"):
scanf("%s",str);
printf("enter the character:");
scanf("%s",ch);
for(int i=0;str[i]!='/0';i++)
{
if(str[i]==ch)
{
rep++;//to count character
str[i]=' ';//to delete the duplicate
}
}
printf("the character is repeated %d times",rep);
printf("now all duplicates are deleted.");
}

Is This Answer Correct ?    5 Yes 13 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What would the following code segment printint k = 8;docout << "k = " << k << " ";while k++ < 5; a) 13 b) 5 c) 8 d) pointers

1241


Explain how can a program be made to print the line number where an error occurs?

1191


Why header file is used in c?

1077


What is function and its example?

1189


What is the need of structure in c?

1100


Write a program in c to replace any vowel in a string with z?

1098


Write a C/C++ program to add a user to MySQL. The user should be permitted to only "INSERT" into the given database.

1956


What does. int *x[](); means ?

1050


application attempts to perform an operation?

1959


How does sizeof know array size?

1104


how we can make 3d venturing graphics on outer interface

4802


Function which gives a pointer to a binary trees const an integer value at each code, return function of all the nodes in binary tree.?

1058


Can you mix old-style and new-style function syntax?

1085


How can I get the current date or time of day in a c program?

1207


why arguments can generally be passed to functions a) sending the values of the arguments b) sending the addresses of the arguments c) a & b d) none of the above

1109