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

How many keywords (reserve words) are in c?

1105


What is #include stdio h?

1078


What are data types in c language?

1028


Explain about block scope in c?

1052


Can an array be an Ivalue?

1069


Why is sizeof () an operator and not a function?

993


What are control structures? What are the different types?

1058


Explain about C function prototype?

1041


If a variable is a pointer to a structure, then which operator is used to access data members of the structure through the pointer variable?

1222


What are the 5 types of organizational structures?

1037


How macro execution is faster than function ?

1150


What are runtime error?

1099


What is the meaning of && in c?

980


What is assert and when would I use it?

975


Why is c called c not d or e?

1066