answersLogoWhite

0

C program to concatenate two strings?

Updated: 8/17/2019
User Avatar

Wiki User

14y ago

Best Answer

#include
#include
void main()
{
char a[30],b[30];
clrscr();
printf("Enter the string a:");
gets(a);
printf("Enter the string b:");
gets(b);
printf("%s",strcat(a,b));
getch();
}

User Avatar

Wiki User

14y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: C program to concatenate two strings?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

How do you concatenate strings in C programming?

strcat if u wnt to use strcat then include string.h header file


Write a c program to copy two strings using pointers?

nahi malum


What symbol is use to join strings?

Language dependent. In C, for example, there no string as such, but you can use function strcat to concatenate zero-terminated character-sequences.


What is concatenate function in c?

strcat


How can you do the same thing as the program below but using strings and arrays in C language?

Program below?!


C program to concatenate two strings without using library function?

#include<stdio.h> #include<conio.h> void main() { char a[10],b[10],c[40]; int i,j; clrscr(); printf("\n\nENTER FIRST STRING:"); gets(a); printf("\n\nENTER SECOND STRING:"); gets(b); for(i=0;a[i]!='\0';i++) c[i]=a[i]; for(j=0;a[j]!='\0';j++) { c[i]=b[j]; i++; } c[i]='\0'; printf("\n\nTHE COMBINED STRING IS:"); puts(c); getch(); }


C program to copy two strings in to a new string with out using stringcopy in borland c?

You can use so called concatenation of strings:{...string str1 = "something here";string str2 = " and something here";string newStr = str1 + str2;...}


Can you tell me a C program to find if the strings are equal using pointers?

It is called strcmp, part of the standard run-time library. Returns 0 if the two strings are equals, non-zero otherwise.


Write a program in 'C' language to accept 6 strings as input and print them in lexicographic?

(ab)*b


How do you concatenate input files in C?

Copy one file, then append the other to the copy.


'c' code to compare two strings using strcmp function?

char one [] = "A string" ;char two [] = "Different String" ;if (strcmp (one, two) == 0){puts ("The two strings are identical") ;}else{puts ("The two strings are different") ;}


How c strings are terminated?

c strings are terminated by \0 character