<span>Int var1 = 0b0001; int var2 = 0b1111; int results1 = var1 & var2; int results2 = var1 | var2; int results3 = var1 ^ var2; int printit = results1 + results2 + results3;
what are the values for results1, results2, results3 and printit after executing the code? notes: 1. faster responses will be obtained if your code is presented line by line (in a file) before posting. 2. please specify language, many languages use the same syntax but could have differences in interpretation -------------------------------------------------------------------------------
Assuming Java as the language. C is similar. </span><span><span>& bitwise AND & ^ </span><span>bitwise exclusive OR </span><span>| bitwise inclusive OR
So results1=var1&var2=0b0001&0b1111=0b0001 results2=var1|var2=0b0001&0b1111=0b1111 results3=var1^var2=0b0001&0b1111=0b1110 printit=results1+results2+results3=0b0001+0b1111+0b1110 =0b10000+0b1110 =0b11110
Note: by default, int has 4 signed bytes, ranging from decimal -2147483648 to +2147483647 </span></span>
The probability of losing per flip is 1/2. Multiply 1/2 by itself 6 times since the condition is asking for the probability for the person to lose 6 times in a row. 1/2 * 1/2 * 1/2 * 1/2 * 1/2 * 1/2 = 1/64. The answer is 1/64.