Question: Consider a situation in a Java / C + + like language in which the add operator is not associative. Assume a , b ,

Consider a situation in a Java/C++ like language in which the add operator is not associative. Assume a, b, and c are declared as integers and integers occupy one byte. Let a be the value 125, b be the value -128, and c be the value -122. Convert each variable into twos complement and perform the addition ((a+b)+c) as well as (a+(b+c)). If an error occurs at any point, stop computing and explain what happened. If no error occurs, give the answer in both twos-compliment and decimal format.

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 Programming Questions!