#include
#include
#include
void main()
{
char a[20],b[10];
int i,j;
clrscr();
printf("\n\n\t string compare & concatenation");
printf("\n\nEnter the 1st string :");
gets(a);
printf("\nEnter the 2nd string :");
gets(b);
if(strcmp(a,b)<0)
{
strcat(a,b);
printf("\n\n Concatenated String :");
puts(a);
}
else
printf("\n\n 2nd String is smaller or equal to 1st");
getch();
}
Saturday, October 11, 2008
Sample C prog. For Concatination of Strings
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment