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
A palindrome is a string that reads the same from both the ends. Given a string S convert it to a palindrome by doing character replacement. Your task is to convert S to palindrome

You are required to give C++ implementation of following classes: 1. PropertyCategories 2. Plot 3. Flat 4. House Following is the description of all data member and member funct

Imagine that the server program is a setuid program owned by the root, then after you penetrate the program with a shell running, you become the ROOT and you can remove the whole f

Receive 3 numbers and display them in ascending order from smallest to largest ed#

Reference Types The symbol "&" is interpreted as an address operator as well as AND operator. This operator is also used to declare a "reference variable". A reference is refer

how to create a shopping cart and sibmit the code segment on screan

I have to make a program that allow the user input 10 numbers between 10 and 100 and if the number input is the same than the last number, should appear an error message. I have th

There are ''n'' ants on a ''n+1'' length rod. The ants are numbered from 1 to n and are initially placed at positions starting from position 1 till position n. They are moving eith

This problem familiarizes you with using random numbers in C++. The program is to compute a good approximation of π using a simulation method called "Monte Carlo". The following fi