I'm trying to write simple program using c to compute the intersection between two strings using Bitwise AND
operator Like :
char x[]="abcdefghijklmnopqrstuvwxyz";
char y[]="abcdefghijklmnopqrstuvwxyz";
int i,sum=0;
const int size = 26;
for(i=0;i<size;i++)
{
if(x[i]&y[i]==y[i]){
printf("%c",y[i]);
sum++;
}
}
printf("\n%d\n",sum);
After executing code i found the result :
acegikmoqsuw
13
what's the problem with my code or what's the reason for that ?