Write a program to concatenate two strings.|Shubham tiwari


Aim:-Write a program to concatenate two strings. (Using only string length function “strlen”)

Source Code:-


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

int main()

{

  char a[1000], b[1000];

  printf("Enter the first string\n");
  gets(a);

 printf("Enter the second string\n");
  gets(b);

 strcat(a, b);

 printf("String obtained on concatenation: %s\n", a);
  return 0;
}
Output


Related Post:-




Post a Comment

0 Comments

Copyright (c) 2019 Designed by Shubham tiwari All Right Reseved