Question: EXERCISES for C++ l ogic operations: predict the result in z after each statement. Always assume that uint8_t PINB = 0x0B; uint8_t x = 0x33;

EXERCISES for C++ logic operations: predict the result in z after each statement. Always assume that

uint8_t PINB = 0x0B;

uint8_t x = 0x33;

int8_t y = 0x82;

uint8_t z;

(a) if (PINB & 1<<5) {

z = 1;

} else {

z = 2;

}

(b) if (y > 0x7A) {

z = 20;

} else {

z = 30;

}

(c) z = x & y;

(d) z = x && y;

(e) z = 0;

while (y < 0) {

++y;

++z;

}

(f) z = 10;

while (x < 0) {

++x;

z += 10;

}

explain your answers please and show the complete code that you would use to find the result with online GDB

Thank you

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock 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 Databases Questions!