# test1-odd.fmCS350 Spring 2020 1/4 Test 1, Thur, 2/20/2020CS350 Spring 2020 1/4 Test 1, Thur, 2/20/2020Spring 2020, CS350 Test 1, Thur, 2/20/2020Name:Make sure you have four pages. Do not...

I have attached 3 Tests below and some notes (slides) below for reference. The purpose of this is not just the answers, but I want to learn, please include calculations and how they are doing ( that's the most important thing) I want to study for the next test and I want to see the both the calculations and notes as part of this submission.
Please do help me understand. I really appreciate your work and effort for helping me learn and hoping that you prepare me well for my exam.

Thank you.

Answered 4 days AfterFeb 09, 2023

## Answer To: test1-odd.fmCS350 Spring 2020 1/4 Test 1, Thur, 2/20/2020CS350 Spring 2020 1/4 Test 1, Thur,...

Baljit answered on Feb 10 2023
Spring 2020
1.
Before solving the question we should the know the maximum and minimum range of float and int in c

float :- 1.2E-38 to 3.4E+38
int:- -2,147,483,648 to 2,147,483,647
·
For float f=40000.0, f*f?
f*f=1.6E+9 which is in the range of float and so f*f>0
· For float f=60000.0, f*f?
f*f=3.6E+9 which is in the range of float and so f*f>0
· For float f=80000.0, f*f?
f*f=6.4E+9 which is in the range of float and so f*f>0
· For int i=40000, i*i?
f*f=1.6E+9 which is in the range of int and so f*f>0
· For int i=60000, i*i?
f*f=3.6E+9 which is out of the range of int so it will give garbage value and so n/a
· For int i=80000, i*i?
f*f=6.4E+9 which is out of the range of int so it will give garbage value and so n/a
2.
Float in c has size 4 bytes so float x has size of 12 bytes. So program will run correctly till x[o],x,x.So core dumped When in function trying to access x in 4th iteration.
3.
Bit wise operatons
· ~0x11
~ operator is called Bitwise NOT and it inverts all the bits. 0x11 is 00010001 in binary. Now we have to just invert the bits from 0 to 1 and 1 to 0.
00010001 → 11101110
11101110 is EE in hexadecimal so our final answer is : 0xEE .
· ~0xFF
we have to perform Bitwise NOT operation. 0xFF is 11111111 in binary.
11111111 → 00000000
00000000 is 00 in hexadecimal so our final answer is : 0x00
· 0x96 ^ 0x96
Now we have to perform Bitwise XOR operation. Bitwise XOR will return 1 if both the bits are different otherwise it will return 0. We are performing this operation on 0x96 and 0x96, as both the numbers are same so Bitwise XOR will return 00000000
00000000 is 00 in hexadecimal so our final answer is : 0x00
· 0x96 & 0x96
Here we have are performing Bitwise AND operation. Bitwise AND will return 1 if both the bits are 1 otherwise it will return 0. We are performing this operation on 0x96 and 0x96, as both the numbers are same so Bitwise AND will return...
SOLUTION.PDF