Server : Apache System : Linux profile 3.10.0-1160.88.1.el7.x86_64 #1 SMP Tue Mar 7 15:41:52 UTC 2023 x86_64 User : apache ( 48) PHP Version : 8.0.28 Disable Function : NONE Directory : /var/www/html/venkat/old/ |
#include<stdio.h>
main()
{char str1[50],str2[25];
int i,j,k;
int count1=0;
scanf("%s",str1);
scanf("%s",str2);
char *p1;
char *p2;
p1=str1;
p2=str2;
k=0;
int d=0;
for(i=0;*(p1+i)!='\0';i++)
{count1++;}
for(i=0;i<count1;i++)
{if (*(p1+i)==*(p2+i)){k++;}}
if (k==count1)
{printf("\n\n%s\n",str1);}
else
{for(j=count1;*(p2+d)!='\0';j++,d++)
{*(p1+j)=*(p2+d);}
printf("\n\n%s\n",str1);
}
}