subject

Bitwise operations in c. write a c program which will either set or clear a single bit in a number entered by the user using the binary representation of the number. the user should input the original integer value between 1 and 1000 inclusive using a scanf. use an unsigned integer type. output is to the screen. you must use only bitwise operators for this program. you can shift bits and or use the logical bitwise operators. for this assignment give the user directions asking them to enter the integer and then ask the user if he or she wants to clear or set a bit. then ask the user which bit to set or clear. that can be a number between 0 and 31. prompt the user for what should be entered each time. be sure to validate all user input so the program cannot be crashed. after completing the operation ask the user if they want to do the entire operation again. the user would enter y or y to do it again. this would be the entire operation from entering the first integer.•if the user enters a 1 as the initial value and a 0 for the bit to clear the result would be 0.•if the user enters a 1 as the initial value and a 0 for the bit to set the result would be 1.•if the user enters a 10as the initial value and a 1 for the bit to clear then the result would be 8.•if the user enters a 10 as the initial value and a 1 for the bit to set then the result would be 10.•if the user enters a 10 as the initial value and a 2for the bit to clear then the result would be 10.•if the user enters a 10 as the initial value and a 2 for the bit to set then the result would be 14.output for each operation should be easy to read giving the number before the switch and then the decimal number after the switch. no other output should be included.

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 19:30
Of the following pieces of information in a document, for which would you most likely insert a mail merge field?
Answers: 3
question
Computers and Technology, 24.06.2019 09:30
Atype of researcher who uses computers to make sense of complex digital data
Answers: 1
question
Computers and Technology, 24.06.2019 10:10
Which view in a presentation program displays a split window showing the slide in the upper half and a blank space in the lower half?
Answers: 1
question
Computers and Technology, 25.06.2019 07:00
Asap 50 points ( paragraph pls) discuss the role of the concept behind the "internet of things (iot)" in today's digitally connected society.
Answers: 2
You know the right answer?
Bitwise operations in c. write a c program which will either set or clear a single bit in a number e...
Questions
question
Mathematics, 18.07.2019 23:00
question
Mathematics, 18.07.2019 23:00
question
Mathematics, 18.07.2019 23:00