Menu

(Solved) : Exercises C Logic Operations Predict Result Z Statement Always Assume Uint8t Pinb 0x0b Uin Q44087595 . . .

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

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 youwould use to find the result with online GDB

Thank you

Expert Answer


Answer to EXERCISES for C++ logic operations: predict the result in z after each statement. Always assume that uint8_t PINB = 0x0B…

OR