Question: Given the following variables, give the result of each of the following operations (show all 8 bits): int num1 =0b00110101, num2 =0b11001010, ans; A. ans

Given the following variables, give the result of each of the following operations (show all 8 bits):
int num1 =0b00110101, num2 =0b11001010, ans;
A. ans = num1 \& num2;
B. ans = num1 | num2;
C. ans \(=\sim\) num2;
D. ans = num1 ^ num2;

Step by Step Solution

3.39 Rating (158 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Sure I can help explain how to execute these bitwise operations Lets start with num1 which is 0b0011... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Introduction Java Program Questions!