C program for function of merge , C/C++ Programming

C Program for FUNCTION OF MERGE

#include conio.h>

#include stdio.h>

char cot(char a[],char b[]);

void main()

{

          char a[50],b[50];

          clrscr();

          printf("ENTER THE FIRST STRING: ");

          gets(a);

          printf("ENTER THE SECOND STRING: ");

          gets(b);

          cot(a,b);

          getch();

}

 

char cot(char a[],char b[])

{

          char p[50]; int i,j;

          for(i=0;a[i]!='\0';i++)

                   p[i]=a[i];

                   p[i]=' ';

          for(j=0;b[j]!='\0';j++)

                   p[i+j+1]=b[j];

          p[i+j+1]='\0';

          printf("%s",p);

}

 

OUTPUT :

ENTER THE 1 STRING: KAMLESH

ENTER THE 2 STRING: MENGAR

 

KAMLESH MENGAR

Posted Date: 9/10/2012 7:49:02 AM | Location : United States







Related Discussions:- C program for function of merge , Assignment Help, Ask Question on C program for function of merge , Get Answer, Expert's Help, C program for function of merge Discussions

Write discussion on C program for function of merge
Your posts are moderated
Related Questions
for object, malloc allocates memory in heap however doesn't invoke object's constructor to initialize the object. new allocates memory & also invokes constructor to initialize the

write a c++ program to find the prime numbers

Inbuilt Functions i).  Functions to manipulate strings The cstring library defines many functions to perform some manipulation operations with C-styled functions. The followi

C Programming and Data Structures 1. Define and explain flow chart with an example. 2. Write an algorithm to print all even numbers in descending order and draw the flowcha

solution of problem based on poiter

#question.gsdjfhjhjfkfk.

Byteland county is very famous for luminous jewels. Luminous jewels are used in making beautiful necklaces. A necklace consists of various luminous jewels of particular colour. Nec

At a shop of marbles, packs of marbles are prepared. Packets are named A, B, C, D, E …….. All packets are kept in a VERTICAL SHELF in random order. Any numbers of packets with thes

Four cells, each with an internal resistance of 0.40 ? and an e.m.f. of 2.5 V are connected in series to a load of 38.40 ?. (a) Verify the current flowing in the circuit and t

Compiler Design - Limit In The Method Instructions