answersLogoWhite

0


Best Answer

#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();

}

User Avatar

Wiki User

11y ago
This answer is:
User Avatar

Add your answer:

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

What character allows you to concatenate strings in PHP?

To concatenate strings in PHP, you use the . (dot) character. For example: $str = "String1" . "String2";


A Write the algorithm to concatenate two given strings?

a write the algorithm to concatenate two given string


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.


How do you concatenate strings in C programming?

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


What is it called when you add up letters?

concatenate is the operation of joining two character strings end to end. For example, the strings "snow" and "ball" may be concatenated to give "snowball".


C program to concatenate two strings?

#include#includevoid 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();}


What is operator over loading?

Same operator can be used for different purposes like + can be used for addition of two integers and used for concatenate strings.


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.


What does the plus in java mean?

It is used for addition - to add two numbers. Also, to concatenate two Strings (texts) - that is, to make a longer text from two shorter ones.


Which sign is used to concatenate two strings?

That depends on the programming language. Most languages use the "+" sign, but a few use other signs. For example, PHP uses the dot.


How do you concatenate two strings without using strcat?

Example1:sprintf (to, "%s%", from1, from2);Example2:size_t len1= strlen (from1);memcpy (to, from1, len1);strcpy (to+len1, from2);


What is use of dot in php?

The dot (.) operator in PHP is used to concatenate strings. For instance:$start = "Big";$end = "Bird";echo $start . ' ' . $end;This code would produce the output:Big Bird