Given two binary numbers A,B .Let the i th bit of A and i th bit of B differ by d. We need to form a binary number C such that the i th bit of C = 1, if 2^d is even, else it should be 0.
Implementation:
Implementation:
#include <stdio.h>
#define max 100
int funct(int j,int k)
{
return j^k;
}
int main()
{
int t;
char a[max],b[max];
scanf("%d",&t);
while(t--)
{
scanf("%s",a);
scanf("%s",b);
for(int i=0;a[i];i++)
printf("%d",funct(a[i]-'0',b[i]-'0'));
printf("\n");
}
return 0;
}