Logo 
Search:

C Programming Articles

Submit Article
Home » Articles » C Programming » Homework HelpRSS Feeds

Program to append one string s2 to another string s1 i.e. concatenation of two strings use strcat function from string.h

Posted By: Jacob Bouchard     Category: C Programming     Views: 3150

Write a program to append one string s2 to another string s1 i.e. concatenation of two strings. (Use strcat function from string.h)

Code for Program to append one string s2 to another string s1 i.e. concatenation of two strings use strcat function from string.h in C Programming

#include<stdio.h>
#include<conio.h>
#include<string.h>
void main()
{
    char a[50],b[50];
    int i,j;
    clrscr();
    printf("\n Please Give The STRING OF A : ");
    scanf("%s",a);
    printf("\n Please Give The STRING OF B : ");
    scanf("%s",b);
    strcat(a,b);
    printf("\n Concatenation of a string is %s .",a);
    getch();
}


--------------------------------- OUTPUT ---------------------------------




 Please Give The STRING OF A : MODI

 Please Give The STRING OF B : BHAVESH



Concatenation of a stringis MODIBHAVESH .



--------------------------------------------------------------------------
  
Share: 



Jacob Bouchard
Jacob Bouchard author of Program to append one string s2 to another string s1 i.e. concatenation of two strings use strcat function from string.h is from Montreal, Canada.
 
View All Articles

Related Articles and Code:


 
Please enter your Comment

  • Comment should be atleast 30 Characters.
  • Please put code inside [Code] your code [/Code].

 
No Comment Found, Be the First to post comment!