Values of type int are 32 bits they are represented in two\'s complement, and th
ID: 3620341 • Letter: V
Question
Values of type int are 32 bits they are represented in two's complement, and they are right shifted arithmetically. values of type unsigned are 32 bits.we generate arbitrary values of x,y, and z and convert them to other forms as follows:
/* create some arbitrary values */
int x = random();
int y = random();
int z = random();
/*convert to other forms*/
unsigned ux = (unsigned) x;
unsigned uy = (unsigned) y;
For each of the following C expressions indicate whether or not the expression always yields 1.
#1 (x-y)
#2 ((x+y)<<4)) + y -x == 17 *y + 15*x
#3 ~x + ~y +1 == ~(x+y)
#4 ux - uy == -(y-x)
#5 (x >=0) || (x< ux)
#6 (( x >> 1) << 1) <= x
Explanation / Answer
6- Yes: x>>1 rounds toward minus infinity. Please rateRelated Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.