Write a c program which will flip a single bit in a number

Assignment Help Computer Engineering
Reference no: EM132196205

Question :

Write a C program which will flip 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 using a scanf. Output is to the screen.

For this assignment give the user directions asking them to enter the integer and then ask them which bit to flip. That can be a number between 0 and 31. After completing the operation ask the user if they want to do it again. You do not need to use getopt for this program.

If the user enters a 1 as the initial value and a 0 for the bit to switch the result would be 0. If the user enters a 10 as the initial value and a 1 for the bit to switch then the result would be 8. . If the user enters a 10 as the initial value and a 2 for the bit to switch then the result would be 14.

The program should compile to create an executable called bitswitch.

Reference no: EM132196205

Questions Cloud

Display the number of words in the file : Write a c++ program that prompts user for file name and displays the number of words in the file.
How much cash does each partner receive in final settlement : A local partnership is liquidating and has only two assets. If the land is sold for $25,000, how much cash does each partner receive in a final settlement
Compute amount of accumulated depreciation on each machine : In recent years, Sheridan Company has purchased three machines. Compute the amount of accumulated depreciation on each machine
Find the volume of a cylinder using any integration method : Write a C++ program to find the volume of a cylinder using any integration method, such as trapezoidal, midpoint, rectangular, Simpson's, etc.
Write a c program which will flip a single bit in a number : Write a C program which will flip a single bit in a number entered by the user using the binary representation of the number.
Find the sum and mean and range of n numbers : Write a C program to find the sum, mean, and range of n numbers. The user inputs the value of n followed by n 64-bit unsorted values.
Write a c program that finds voltage drop and power : Write a C program that finds voltage drop and power dissipated by a resistance (R) when a current (I) flows through it.
Write research paper realated to history : Choose a key battle instead of a whole war, for example. If you have any questions on subject matter, please contact your instructor
Find weight and potential energy associated with a body : Write a C program that finds weight and potential energy associated with a body falling from a height (h) and mass (m).

Reviews

Write a Review

Computer Engineering Questions & Answers

  Explain how will operating income be affected

If $22364 in fixed costs will be eliminated by dropping the Pitcher line, how will operating income be affected? If income drops, use a negative sign in front.

  1 give an example of how efforts in the development of

1. give an example of how efforts in the development of software can pay dividends later in software maintenance.2.

  What is the format of main memory address

What is the format of main memory address.

  Design a secure enterprise wireless network

Investigate and report the ethical implications in the design and implementation of a secure enterprise wireless network

  Why the new approach is better than the other six kernels

How the result of each one is different from the other. Why the new approach is better than the other 6 Kernels.

  At what airspeed does direct cooling become impossible

An aircraft oil cooler is to be constructed using the skin of the wing as the cooling surface. The wing may be idealized as a flat plate over which air.

  Defining the class counter

Write down the definition of the class counter consisting of: An instance variable named counter of type int. A constructor which takes one int argument and allocates its value to the counter.

  Describe the principles behind the field of ai

Describe the principles behind the field of AI; What are some of the technologies that is fueling the rapid development and advancement of AI.

  Write a program that uses a function named length

Write a program that uses a function named length to compute the length of a string that is input from the keyboard.

  Show effect of error propagation when ecb uses cts technique

Show the effect of error propagation when ECB uses the CTS technique. Show the effect of error propagation when CBC uses the CTS technique.

  Give the declaration for two variable called feet and inches

Give the declaration for two variables called feet and inches. Both variables are of type int and both are to be initialized to zero in the declaration.

  In brief explain your role as an employee of an

briefly describe your role as an employee of an organization in the is field. give examples of what you need to know

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd