//WAP TO CONCATENATE TWO STRINGS.
#include<stdio.h>
#include<conio.h>
#include<string.h>
void main()
{
char A[20],b[20];
clrscr();
puts("\nENTER THE STRING:");
gets(A);
puts("\n\nENTERED STRING IS");
puts("\n\n");
puts(A);
puts("\nENTER THE STRING:");
gets(b);
puts("\n\nENTERED STRING IS");
puts("\n\n");
puts(b);
strcat(A,b);
printf("\n\nAFTER CONCATINATION STRING IS:%s",A);
getch();
}
/*---------------------------------------------------------
OUTPUT
-----------------------------------------------------------
ENTER THE STRING:
ABHISHEK
ENTERED STRING IS
ABHISHEK
ENTER THE STRING:
WADHWA
ENTERED STRING IS
WADHWA
AFTER CONCATINATION STRING IS:ABHISHEKWADHWA
*/
#include<stdio.h>
#include<conio.h>
#include<string.h>
void main()
{
char A[20],b[20];
clrscr();
puts("\nENTER THE STRING:");
gets(A);
puts("\n\nENTERED STRING IS");
puts("\n\n");
puts(A);
puts("\nENTER THE STRING:");
gets(b);
puts("\n\nENTERED STRING IS");
puts("\n\n");
puts(b);
strcat(A,b);
printf("\n\nAFTER CONCATINATION STRING IS:%s",A);
getch();
}
/*---------------------------------------------------------
OUTPUT
-----------------------------------------------------------
ENTER THE STRING:
ABHISHEK
ENTERED STRING IS
ABHISHEK
ENTER THE STRING:
WADHWA
ENTERED STRING IS
WADHWA
AFTER CONCATINATION STRING IS:ABHISHEKWADHWA
*/
No comments:
Post a Comment