Question

. Logic operations in C++: predict each line's result, given that     PINB = 0x0B, uint8_t...

. Logic operations in C++: predict each line's result, given that

    PINB = 0x0B, uint8_t x = 0x33, int8_t y = 0x81

(d) z = x && y;

(e) z = 0;

     while (y < 0) {

         ++y;

         ++z;

     }

(f) z = 10;

     while (x < 0) {

         ++x;

         z += 10;

     }

0 0
Add a comment Improve this question Transcribed image text
Answer #1

d) z = x && y;
This line calculates the logical AND of x and y, i.e if both x and y are non-zero than result is 1 otherwise result is 0.

e) z = 0;
     while (y < 0) {
         ++y;
         ++z;
     }
The above code segment increments the values of y and z by 1 until the value of y is less than 0, i.e the while loop terminates when the value of y becomes equal to 0.

f) z = 10;
     while (x < 0) {
++x;
   z += 10;
}
The above code segment increments the value of x by 1 and value of z by 10 until the value of x is less than 0, i.e the while loop terminates when the value of x becomes equal to 0.

If the answer helped then please upvote, it means a lot.
And for any queries,please comment.

Add a comment
Know the answer?
Add Answer to:
. Logic operations in C++: predict each line's result, given that     PINB = 0x0B, uint8_t...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT