subject

Write a C program to run on ocelot 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. You do not need to use getopt for this program

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 07:00
Robots with telescoping arms are sometimes used to perform tasks (e.g., welding or placing screws) where access may be difficult for other robotic types. during a test run, a robot arm is programmed to extend according to the relationship r = 3 + 0.5cos(4θ) and the arm rotates according to the relationship θ=−π4t2+πt , where r is in feet, θ is in radians, and t is in seconds. use a computer program to plot the path of tip a in x and y coordinates for 0 ≤ t ≤ 4s.
Answers: 2
question
Computers and Technology, 22.06.2019 22:30
The qwerty keyboard is the most common layout of keys on a keyboard
Answers: 3
question
Computers and Technology, 23.06.2019 13:30
Best laptops for college [$100-$500 range]?
Answers: 2
question
Computers and Technology, 23.06.2019 19:00
Acompany is hiring professionals for web designing. the firm is small with few resources. they want employees who possess problem-solving skills and can independently carry out responsibilities. which kind of employee should they select?
Answers: 2
You know the right answer?
Write a C program to run on ocelot which will either set or clear a single bit in a number entered b...
Questions
question
Mathematics, 25.09.2019 01:00
question
Social Studies, 25.09.2019 01:00
question
Mathematics, 25.09.2019 01:00
Questions on the website: 13722367