Concat two string with most overlapped substring has to
remove  "abcd"+ "cdef" = "abcdef

Answer Posted / tarak

#include<stdio.h>
main()
{
char *a="abcd";
char *b="cdef";
char c[10];
int i=0;
while(*a != *b)
{
c[i] = *a++;
i++;
}
while(*b != '\0')
{
c[i]= *b++;
i++;
}
printf("%s\n",c);
}

Is This Answer Correct ?    4 Yes 6 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What does 3 mean in texting?

622


What is a void * in c?

602


Create a registration form application by taking the details like username, address, phone number, email with password and confirm password (should be same as password).Ensure that the password is of 8 characters with only numbers and alphabets. Take such details for 3 users and display the details. While taking input password must appear as “****”.

2652


count = 0; for (i = 1;i < = 10; i++);count = count + i; Value of count after execution of the above statements will be a) 0 b) 11 c) 55 d) array

681


Explain what is wrong with this statement? Myname = ?robin?;

1043






What is the scope of static variable in c?

538


How to delete a node from linked list w/o using collectons?

2093


Is Exception handling possible in c language?

1588


Why c language is called c?

573


Explain is it better to use a pointer to navigate an array of values, or is it better to use a subscripted array name?

678


Explain how can I avoid the abort, retry, fail messages?

595


What is Dynamic memory allocation in C? Name the dynamic allocation functions.

562


#include main() { char s[] = "Bouquets and Brickbats"; printf(" %c, ",*(&s[2])); printf("%s, ",s+5); printf(" %s",s); printf(" %c",*(s+2)); }

670


How can I trap or ignore keyboard interrupts like control-c?

622


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

632