-->
Showing posts with label WAP to concatenate /merge two strings using strcat() function.. Show all posts
Showing posts with label WAP to concatenate /merge two strings using strcat() function.. Show all posts

WAP to concatenate /merge two strings using strcat() function.

using turboc++
--------------------------------------------------------------------------------------------------
//WAP to merge  two strings  using(strcat()) function.
#include <stdio.h>
#include<string.h>
#include<conio.h>
int main()
{
    char st[100],st1[100];//two string declaration
    printf("enter first string\n");
    gets(st);
    printf("enter second string\n");
     gets(st1);//inputs
    strcat(st,st1);//merging st1 string into first (st)
    printf("merged string =%s\n",st);//prints the merged strings(st)
   getch();
    return 0;
}


---------------------------------------------------------------------------------------------------
using codeblocks
----------------------------------------------------------------------------------------------------
//WAP to merge  two strings  using(strcat()) function.
#include <stdio.h>
#include<string.h>
int main()
{
    char st[100],st1[100];//two string declaration
    printf("enter first string\n");
    gets(st);
    printf("enter second string\n");
     gets(st1);//inputs
    strcat(st,st1);//merging st1 string into first (st)
    printf("merged string =%s\n",st);//prints the merged strings(st)
    return 0;
}