Here’s a program to concatenate two strings without using strcat() function using C Programming Language

 #include<stdio.h>
 #include<conio.h>
 int main() { 
 char name1[20]; char name2[20]; char name3[40];
 int l1,l2,i,f=1,temp;
 printf("Enter first string value: n");
 gets(name1);
 l1=0; while(name1[l1]!=''){ l1++; } l2=0;
 printf("Enter second string value: n");
 gets(name2);
 while(name2[l2]!=''){ 
 l2++;
 } //printf("First Stringlength is %d",l1);
 //printf("Second String length is %d",l2);
 i=0; temp=0;
 while(i name3[i]=name1[i];
 temp++; i++;
 } i=0; while(i name3[temp]=name2[i];
 temp++; i++;
 } printf("The concatenate string is :%s",name3);
 return 0; }

Output:-Enter first string value: Code
Enter second string value: verb
The concatenate string is :Codeverb

This article is written by our awesome writer
Comments to: Program to concatenate two strings without using strcat() function in C

Your email address will not be published. Required fields are marked *

Attach images - Only PNG, JPG, JPEG and GIF are supported.

New Dark Mode Is Here

Sign In to access the new Dark Mode reading option.

Join our Newsletter

Get our monthly recap with the latest news, articles and resources.

By subscribing you agree to our Privacy Policy.

Latest Articles

Explore Tutorials By Categories

About

Codeverb is simply an all in one interactive learning portal, we regularly add new topics and keep improving the existing ones, if you have any suggestions, questions, bugs issue or any other queries you can simply reach us via the contact page

Login

Welcome to Codeverb

Ready to learn something new?
Join Codeverb!

Read Smart, Save Time
  •  
    Strength indicator
  •  
  •  
    Log In | Lost Password