Question
Write a C Program to Concatenate Two Strings Without Using strcat() function
Answer :
Word Count : 388
__________ ___ ________ __________ ______ ____.
______ _________ __________ ____ ______ ____ _________ ___ __________ ________ ________.
___ _________ _________ ____ ______ __________ __________ _________ _______ _________ _______.
_________ _____ ______ __________ ___ _________.
________ ______ ___ ______ ______ ____ _____ ________ ____ _____ ____ _________.
___ _______ ________ ____ _______ ____ ________ ___ ___ _______.
__________ _________ _____ _______ _______ _________ __________ ______ _________ ____ ________.
___ ______ ______ ________ __________ ___ ______ ___ ______ ________ _________.
_______ _____ ________ _______ _____ ________.
________ ___ ________ ________ _____ ____ _____.
____ _____ _____ ___ ___.
________ ___ _______ _______ ____ _________.
____ _______ ________ ______ ________ ___ _____.
_______ ________ ______ _____ ______ __________ ___ _________ ___ __________ _____ _____.
____ _______ ______ ______ ________ _____ _________ _________ ________ ___ _______ ___.
___ __________ ____ ______ _________.
____ ____ ________ _____ __________.
_________ _____ ________ ___ _______ ___.
____ _________ ___ _____ ________ ____ _____ ________ _____ _________ __________ ______.
______ _________ ___ _____ ____ ____ ___ ____ _______ ____.
______ ___ _____ __________ ________ _________.
______ ___ ___ ________ ________ _______ _______ ___ ____ ________ _____.
_____ _____ _____ ______ _________ ______.
_________ ____ _______ _________ ________ _____ _______ ____.
__________ ____ ______ ______ __________ _____ ________ _______ ______ _________ _______ ____.
_____ ____ __________ __________ ________ ____ __________.
_____ ____ _________ ____ _________ _______ _______ ________ ________ _________ _________ ____.
_______ _______ ___ _________ ________ _________ _____ _____ __________ _____ ___.
_____ __________ ___ ______ _______ ________ _________ __________.
Skip in 10
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
Continue Reading — It's Free
Sign in with Google to unlock more of this answer.
✓ Free access
✓ Unlock up to 60% of the answer
✓ No payment required
✓ Unlock up to 60% of the answer
✓ No payment required
Quick Google sign-in. No separate registration form.