Question related to logic & boolean algebra PLEASE PROVIDE COUNTER EXAMPLES FOR
ID: 3666374 • Letter: Q
Question
Question related to logic & boolean algebra
PLEASE PROVIDE COUNTER EXAMPLES FOR FALSE STATEMENTS
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. Values of type float are represented using the 32-bit IEEE floating point format, while values of type double use the 64-bit IEEE floating point format. We generate arbitrary values x, y, and z. and convert them to other forms as follows: For each of the following C expressions, you are to indicate whether or not the expression always yields 1. If so. answer "Y". If not. answer "N".Explanation / Answer
1. (x<y) == (--x > --y)
Ans: N , ex- x =5, y = 7
2. ((x+y)<<4) + y-x == 17*y+15*x
Ans: N, ex- x= 2, y =2
3. x+y+1 = (x+y)
Ans: N, ex- x=4,y=8;
4. ux -uy == -(y-x) // -(y-x) = (x-y)
Ans: N, ex- x =4, y = -9
5. (x>=0) || (x<ux)
Ans: Y
6. ((x>>1)<<1)<=x
Ans: Y
7. (double)(float)x == (double)x
Ans: Y
8. dx + dy ==(double)(y+x)
Ans: Y
9. dx+(dy+dz)==dz+(dy+dx)
Ans: Y
10. dx*(dy*dz)==dz*(dy*dx)
Ans: Y