Answer Posted / prakashdasari
char *str1,*str2,*res;
while(*str1!=NULL)
str++;
while(*str2!=NULL)
{
*str1 == *str2;
str1++;
str2++;
}
*str1 = '\0';
//so total string is in one string ie str1 itself;
//now i will remove duplicates from entire string
for(i=0;str[i]!=NULL;i++)
{
for(j=0;str[j]!=NULL;j++)
{
if(str[i]==str[j])
{
flag = 1;break;
}
else flag = 0;
}
if(flag == 0)
{
*res = str[i];
res++;
}
*res = '\0';
}
now resultant string (res) is union of two character
arrays....
| Is This Answer Correct ? | 6 Yes | 1 No |
Post New Answer View All Answers
Write a program which returns the first non repetitive character in the string?
What is void main ()?
In the DOS enveronment, normal RAM that resides beyond the 1mb mark. a) expanded memory b) swapped memory c) Extended memory d) none
Why n++ execute faster than n+1 ?
What is a macro?
Is there any algorithm to search a string in link list in the minimum time?(please do not suggest the usual method of traversing the link list)
explain what are pointers?
Write a program to know whether the input number is an armstrong number.
Explain what is page thrashing?
Write a Program to accept different goods with the number, price and date of purchase and display them
What is the difference between c &c++?
Why pointers are used in c?
Explain modulus operator.
Where does the name "C" come from, anyway?
How to find a missed value, if you want to store 100 values in a 99 sized array?