Hey guys any ideas why this little piece of code is not outputing the results im expecting.
Operand1 is '10111011' and Operand2 is '00111000'. The output is 00000000 not 00111000 which is what im expecting.Code:void And(char *Operand1,char *Operand2) { int i; printf("%20s",""); for(i=0;i<8;i++) { if( (Operand1[i] && Operand2[i]) !='1') putchar('0'); else putchar('1'); } putchar('\n'); return; }
Thanks
Chris