C program for Concatenation of string (Manual)

#include <stdio.h>
int main()

 {
    char s1[50], s2[50];
    int i, j;

    printf("Enter the string : ");
    scanf("%s %s", s1, s2);

    for(i = 0; s1[i] != '\0'; i++);

    for(j = 0; s2[j] != '\0'; j++) 
{
        s1[i] = s2[j];
        i++;
    }
    s1[i] = '\0';

    printf("Result: %s", s1);
}

Comments

Popular posts from this blog

Single Program Using All Automatic String Functions

C program for subtraction of two matrices (2D Arrays)

C program for Multiplication of Two matrices