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
What is an example of structure?
How to set file pointer to beginning c?
how do you execute a c program in unix.
Explain the meaning of keyword 'extern' in a function declaration.
To print the pattern 1 2 3 4 5 10 17 18 19 6 15 24 25 20 7 14 23 22 21 8 13 12 11 10 9
Why are some ANSI/ISO Standard library routines showing up as undefined, even though I've got an ANSI compiler?
What is assignment operator?
Explain what are run-time errors?
a parameter passed between a calling program and a called program a) variable b) constant c) argument d) all of the above
In cryptography, you could often break the algorithm if you know what was the original (plain) text that was encoded into the current ciphertext. This is called the plain text attack. In this simple problem, we illustrate the plain text attack on a simple substitution cipher encryption, where you know each letter has been substituted with a different letter from the alphabet but you don’t know what that letter is. You are given the cipherText as the input string to the function getwordSets(). You know that a plain text "AMMUNITION" occurs somewhere in this cipher text. Now, you have to find out which sets of characters corresponds to the encrypted form of the "AMMUNITION". You can assume that the encryption follows simple substitution only. [Hint: You could use the pattern in the "AMMUNITION" like MM occurring twice together to identify this]
What is dynamic memory allocation?
write a program in c language to print your bio-data on the screen by using functions.
How is actual parameter different from the formal parameter?
Explain how do you search data in a data file using random access method?
Can we assign string to char pointer?