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
write a program to print largest number of each row of a 2D array
what is the differnce between programing langauge and tool? is sas is a programing langauge r tool?
Explain what are bus errors, memory faults, and core dumps?
What is sizeof array in c?
formula to convert 2500mmh2o into m3/hr
what are bit fields? What is the use of bit fields in a structure declaration?
What is the use of linkage in c language?
What is a pointer in c plus plus?
What is difference between Structure and Unions?
What are the advantages of c preprocessor?
What is the purpose of the statement: strcat (S2, S1)?
What is malloc() function?
What is default value of global variable in c?
What are the advantages and disadvantages of a heap?
Devise a program that inputs a 3 digit number n and finds out whether the number is prime or not. Find out its factors.