programming9
  • Flowcharts
  • Programs
      • Back
      • C Programs
      • C++ Programs
      • Java Programs
      • Python Codes
      • HTML Codes
      • Java Script Codes
      • SQL Codes
  • Tutorials
      • Back
      • Java Tutorials
      • Competitive Programming
      • Python Tutorials
      • C Programming
  • Blog
  • Login

C Program for String Concatenation without using strcat()

Details
Written by: RajaSekhar
Category: C Programs
  • C Functions
#include <string.h>
#include <stdio.h>

int main()
{
    int i,len=0,j;
    char str[50],str1[50],ch,ch1;
    printf("\nEnter the First String : " );
    gets(str);
    printf("\nEnter the Second String : " );
    gets(str1);
    for(i=0; str[i]!='\0'; i++)
    {
        len++;
    }
    for(i=0; str1[i]!='\0'; i++)
    {
        str[len++]=str1[i];
    }
    str[len]='\0';
    printf("\n Concatenated String is: %s ",str);
    return 0;
}

 OUTPUT:

Enter the First String : Programming9

Enter the Second String : .com

 Concatenated String is: Programming.com
Previous article: C Program to Find Simple Interest Prev Next article: C Program to Print Reverse of a String without strrev() function Next
  • C Program to Implement RADIX SORT
  • C Program to Implement CONTINUE statement
  • C Program for Insertion Sort
  • C Program to Print Reverse of a String without strrev() function
  • C program to Implement BREAK Statement
  • C Program to Find Biggest of Two Numbers using Ternary
  • C Program to Simulate PRIORITY CPU Scheduling Algorithm
  • C Program to Print PRIME Numbers in a Given Range
  • C Program for MERGING of Two Arrays with out using Third Array
  • C Program to Find String Length with out using Function
  • Fizz Buzz Implementation in C
  • C Program to Copy Contents From One File to Another
  • C Program to convert Celsius to Fahrenheit
  • Swapping of Two Numbers Using Call By Reference in C
  • C Program to Find Largest Element in an Array
  • Privacy Policy
  • Cookie Policy
© programming9.com 2025
Back to top