Write a program that demonstrates the joining of two strings using library function strcat( ).

C Programming Language / String in C Language

1063

Program:

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

int main()
{
  char s[30] ="Hello,";
  char str[] ="world!";

  printf("%s\n", s);
  strcat(s, str);

  printf("%s\n", s);
 
  return 0;
 }

Output:

Hello,
Hello,world!

 

Explanation:

None

This Particular section is dedicated to Programs only. If you want learn more about C Programming Language. Then you can visit below links to get more depth on this subject.