Assuming System Represent Integers Using 1 Byte 8 Bits Result Following Operation Unsigned Q37079835

Assuming a system represent integers using only 1 byte (8 bits),what is the result of the following operation:

unsigned int a = 1;

cout << a – 2 << endl;

a.) 255

b.) 0

c.) 1

d.)254

e.)-1


Solution


a = 1a-1 is 0a-2 is 255 because valid range of “unsigned int” is 0-255Answer: a.) 255

Please let me know if you have any doubts Please upvote this answer. Thanks!!

Please let me know if you have any doubts Please upvote this answer. Thanks!!

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.