Question

 

Write a C Program to Concatenate Two Strings Without Using strcat() function

24 Feb 2025
Answer :
Word Count : 388

Certainly! Below is a C program that concatenates two strings without using the `strcat()` function. Instead, the program manually appends the characters of the second string to the first string.

### C Program:
```c
#include <stdio.h>

void concatenateStrings(char str1[], char str2[]) {
    int i = 0, j = 0;

    // Move to the end of the first string
    while (str1[i] != '\0') {
        i++;
    }

    // Append characters of second string to first string
    while (str2[j] != '\0') {
        str1[i] = str2[j];
        i++;
        j++;
    }

    // Null terminate the concatenated string
 

__________ ___ ________ __________ ______ ____.
______ _________ __________ ____ ______ ____ _________ ___ __________ ________ ________.
___ _________ _________ ____ ______ __________ __________ _________ _______ _________ _______.
_________ _____ ______ __________ ___ _________.
________ ______ ___ ______ ______ ____ _____ ________ ____ _____ ____ _________.
___ _______ ________ ____ _______ ____ ________ ___ ___ _______.
__________ _________ _____ _______ _______ _________ __________ ______ _________ ____ ________.
___ ______ ______ ________ __________ ___ ______ ___ ______ ________ _________.
_______ _____ ________ _______ _____ ________.
________ ___ ________ ________ _____ ____ _____.
____ _____ _____ ___ ___.
________ ___ _______ _______ ____ _________.
____ _______ ________ ______ ________ ___ _____.
_______ ________ ______ _____ ______ __________ ___ _________ ___ __________ _____ _____.
____ _______ ______ ______ ________ _____ _________ _________ ________ ___ _______ ___.
___ __________ ____ ______ _________.
____ ____ ________ _____ __________.
_________ _____ ________ ___ _______ ___.
____ _________ ___ _____ ________ ____ _____ ________ _____ _________ __________ ______.
______ _________ ___ _____ ____ ____ ___ ____ _______ ____.
______ ___ _____ __________ ________ _________.
______ ___ ___ ________ ________ _______ _______ ___ ____ ________ _____.
_____ _____ _____ ______ _________ ______.
_________ ____ _______ _________ ________ _____ _______ ____.
__________ ____ ______ ______ __________ _____ ________ _______ ______ _________ _______ ____.
_____ ____ __________ __________ ________ ____ __________.
_____ ____ _________ ____ _________ _______ _______ ________ ________ _________ _________ ____.
_______ _______ ___ _________ ________ _________ _____ _____ __________ _____ ___.
_____ __________ ___ ______ _______ ________ _________ __________.
IGNOU ACADEMY
Your IGNOU journey, made easier.
  • Solved Assignments
  • Study Notes
  • Guess Papers
  • Question Papers
Skip in 10
Top
📞
Call Support Instant phone assistance IGNOU BEY 20 2025 -  Write a C Program to Concatenate Two Strings Without Using s | IGNOU Academy
→
🟢
WhatsApp Chat Fast live messaging
→
Email Us Business enquiries & support
→