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 can you determine the maximum value that a numeric variable can hold?

1239


What is the difference between strcpy() and memcpy() function in c programming?

1096


What are the data types present in c?

1168


What is the importance of c in your views?

1176


how to make a scientific calculater ?

2077


Where does the name "C" come from, anyway?

1175


Can main () be called recursively?

1128


What is the difference between malloc() and calloc() function in c language?

1087


Is a house a mass structure?

1098


what is ur strangth & weekness

2440


why programs in c are running with out #include? some warnings are display in terminal but we execute the program we get answer why? eg: main() { printf("hello world "); }

1772


Write an algorithm for implementing insertion and deletion operations in a singly linked list using arrays ?

3525


List the difference between a While & Do While loops?

1113


What do you know about the use of bit field?

1051


What is the code in while loop that returns the output of given code?

2001