C program for merge two strings , C/C++ Programming

C Program for MERGE TWO STRINGS

main()

{

          char a[100],b[100];

          int i=0,j,k=0;

          clrscr();

          printf("ENTER THE FIRST STRING: ");

          gets(a);

          printf("ENTER THE SECOND STRING: ");

          gets(b);

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

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

                             a[i]=b[j];

          a[i]='\0';

          printf("\n%s",a);

          getch();

}

OUTPUT :

ENTER THE 1 STRING: KAMLESH

ENTER THE 2 STRING: MENGAR

 

KAMLESH MENGAR

 

Posted Date: 9/10/2012 2:59:17 AM | Location : United States







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

Write discussion on C program for merge two strings
Your posts are moderated
Related Questions
Function Overloading Function overloading is a form of polymorphism. Function overloading facilitates explaining one function having many forms. In other words it facilitates e


Prepare Windows Shell Extension Project Description: Skills required are C++ Programming, Windows Desktop, Windows API


Add a function for saving the text stored in an array to a file. Your program must check whether or not the output file already exists, and if it does, your program must ask the us

A: Provide a friend operator class Base { public: friend std::ostream& operator ... protected: virtual void printOn(std::ostream& o) const; }; inline std::ostr

Write a program to find the area under the curve y = f(x) between x = a and x = b, integrate y = f(x) between the limits of a and b. The area under a curve between two points can b


Exceptions. Your SVector class should throw four exceptions: 3.1. If the constructor size is invalid, then it will just allow the implicit STL bad_alloc exception to pass up to mai

Write a program that computes the cost of a long distance call. The cost of the call is determined according to the following rate schedules. a. A call made between 8:00 AM and