Monday, 5 October 2015

Write a program to join two strings.

  
   
#include<stdio.h>
#include<string.h>
//#include<conio.h>
void main() {
    char a[100], b[100];
    printf("Enter the first string\n");
    gets(a);
    printf("Enter the first string \n");
    gets(b);
    strcat(a, b);
    printf("String after joining is %s\n", a);
}
Note: Remove the comment line when you are use Turbo C IDE for run your program.

No comments:

Post a Comment