String Concatenate in C
#include<stdio.h>
#include<conio.h>
#include<string.h>
main()
{
char s1[10];
char s2[10];
printf("please enter the first string: ");
gets(s1);
printf("please enter the second string: ");
gets(s2);
strcat(s1,s2);
puts(s1);
getch();
}
#include<stdio.h>
#include<conio.h>
#include<string.h>
main()
{
char s1[10];
char s2[10];
printf("please enter the first string: ");
gets(s1);
printf("please enter the second string: ");
gets(s2);
strcat(s1,s2);
puts(s1);
getch();
}
0 Comments