Answered step by step
Verified Expert Solution
Question
1 Approved Answer
URGENT: please solve this in C language thank you so much Q4. (25 marks) Write a C program that - reads an integer value in
URGENT: please solve this in C language thank you so much
Q4. (25 marks) Write a C program that - reads an integer value in decimal - displays this value in binary 2-byte format - defines the MASK to do the followings: (students are requested to explain the detailed solutions in a Word file as instructed in the class) a. Check either one of four bits 2, 5, 7 or 15 is true. Test with two values: 23094 and 26963 (5 marks) b. Check three bits 3, 7 and 13 are all false. Test with two values: 39478 and 22933 (5 marks) C. Set four bits 1, 8, 12 and 14. Check with value: 39606 (5 marks) d. Toggle four bits 2, 7, 11 and 12. Check with value: 21308 (5 marks) a. Either one of four bits 2,5, 8 or 15 is true Bit 15 13 12 11 10 14 9 9 Co 7 7 6 6 5 4 4 3 2 1 0 MASK nVal 23094 Result nVal 26963 Result b. Check three bits 3, 7 and 13 are all false 15 14 13 12 11 10 Bit 9 8 N 6 5 3 2 2 7 0 MASK n Val 39478 Result n Val 22933 Result c. Set four bits 1, 3, 12 and 14 Bit 15 14 13 12 11 10 9 9 8 Co 7 6 6 5 5 4 3 2 2 1 0 MASK nVal 39606 ResultStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started