Write a C program to remove the repeated characters in the
entered expression or in entered characters(i.e) removing
duplicates
Answers were Sorted based on User's Feedback
Answer / 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 |
Answer / nallavelli srinivas
MAIN()
{ int lsu=0;
char name[50];
pf("enter the string");
sf("%S",name);
printf(name[0]);
while(name[i]!='\0')
{
if(name[i]!=lsu){pf(name[i]);
lsu=name[i];
}
}
}
Is This Answer Correct ? | 1 Yes | 5 No |
Answer / 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 |
a way in which a pointer stores the address of a pointer which stores the value of the target value a) reference b) allocation c) multiple indirection d) none
What is mean by Data Driven framework in QTP? Can any one answer me in details on this regard.
Is null equal to 0 in sql?
Is reference used in C?
When I tried to go into a security sites I am denied access and a message appeared saying 'applet not initialize'. How can I rectify this problem.
What is C language Terminator?
Why structure is used in c?
Why c is procedure oriented?
What are different storage class specifiers in c?
how to print 212 as Twohundreds twelve plz provide me ans soon
Explain what is the benefit of using enum to declare a constant?
What is typedef example?