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
int i[2], j; int *pi;i[0] = 1; i[1] = 5; pi = i; j = *pi + 1 + *(pi + 1)Value of j after execution of the above statements will be a) 7 b) 6 c) 4 d) pointer
What is optimization in c?
how logic is used
What is the difference between c and python?
write a program that declares an array of 30 elements named "income" in the main functions. then cal and pass the array to a programmer-defined function named "getIncome" within the "getIncome" function, ask the user for annual income of 30 employees. then calculate and print total income on the screen using the following function: "void getIncome ( ai []);
What is struct node in c?
What is use of bit field?
Find MAXIMUM of three distinct integers using a single C statement
What the advantages of using Unions?
Can stdout be forced to print somewhere other than the screen?
What is volatile variable how do you declare it?
Write a code to achieve inter processor communication (mutual exclusion implementation pseudo code)?
write a c program to find the largest and 2nd largest numbers from the given n numbers without using arrays
Is exit(status) truly equivalent to returning the same status from main?
What is pivot in c?