C Program Of Strncat() Function

C Program Of Strncat() Function

#include<stdio.h>
#include<string.h>

main()
{

char str1[100];
char str2[100];

printf("Enter string 1:\n");
scanf("%s",str1);

printf("Enter string 2:\n");
scanf("%s",str2);

printf("string 1 is '%s' and string 2 is '%s'\n",str1,str2);

strncat(str1,str2,4);


printf("Aftre concatation string 1 is '%s' and string 2 is '%s'\n",str1,str2);    //print string 1 and two after concate.

}

Related Posts