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

hi... can anyone help me to make a two-dimensinal arrays in finding the sum of two elements plzzz. thnx a lot...

1865


What is clrscr ()?

1059


What is a union?

991


Why can’t constant values be used to define an array’s initial size?

1328


#include int main(){ int i=10; int *ptr=&i; *ptr=(int *)20; printf("%d",i); return 0; } Output: 20 can anyone explain how came the output is 20

1679


What are the primitive data types in c?

1008


Difference between MAC vs. IP Addressing

1100


Describe the order of precedence with regards to operators in C.

1005


I need previous papers of CSC.......plz help out by posting them.......

2249


Is null equal to 0 in sql?

1092


What math functions are available for integers? For floating point?

1078


What is the difference between #include

and #include “header file”?

973


What are qualifiers?

977


Explain how can a program be made to print the name of a source file where an error occurs?

1136


What is the use of sizeof () in c?

996