Write a program that will ask the user to enter an integer

Assignment Help Computer Engineering
Reference no: EM132168325

using C programming

1.Write a function that will reverse the order of the elements of an array of int variables. In the main() function declare an 8-element integer array, then have the user enter the value of each element using a loop. The program should then call the other function to reverse the order of the elements in the array, and then print the values of the resulting array to the screen.

2. Write a program to input a string from the user - use a loop and the getchar() function (similar to the "capitalize.c" example program we looked at in class). The program should then convert the string to all lowercase letters, and put each word on its own line. Print the new string.

Example:

Enter a string: This Is A STRING.

this is a string.

3) Write a program that will ask the user to enter an integer. The program should check if the 3rd least significant bit of the number (in binary) is a '1' or '0', and tell the user. If the bit was a '0' the program should set the bit to '1'; if the bit was a '1' it should clear the bit to zero. The program should then display the new resulting integer number.

4) Write a program that will determine the number of bits required to represent a positive integer. The program should have the user enter a decimal integer, then use a loop with a bitwise operator to determine the number of bits in its binary representation. For example, if the user entered "18" (which in binary is 10010) the program should indicate 5 bits. (Hint: start at the highest order bit and look for the first '1').

Example:

Enter a positive integer: 18

Number of bits: 5

Reference no: EM132168325

Questions Cloud

What is the role of safety stock in an mrp system : A. Data Integrity is a big deal in industry, Why? B. What is the role of safety stock in an MRP system?
Write a program that reads students names followed : Write a program that reads students' names followed by their test scores. The program should output each student's name followed.
Write an analysis about why you chose the given npo : As part of the course project, in Week 1, you will select an NPO of your choice. You should choose an organization in which an appropriate executive or manager.
What are the basis controllable variables of a production : What are the basis controllable variables of a production planning problem? What are the four major costs?
Write a program that will ask the user to enter an integer : Write a function that will reverse the order of the elements of an array of int variables.
Determine the upper and lower control limits : (i) Determine the upper and lower control limits for an X-Bar chart and R-chart with a sample size of four.
Calculate the change in consumer surplus : Calculate the change in consumer surplus and producer surplus from i) to ii). Is the original ban of international trade in Tim Tams efficient? Why or why not
Write a subprogram that removes all of the blanks : Write a subprogram that removes all of the blanks from a character array and "compacts" all non-blank characters in the array.
Consider your university or college : Consider your university or college .what do you think are the challenges their course delivery operations face in providing you with good service?

Reviews

Write a Review

Computer Engineering Questions & Answers

  Mathematics in computing

Binary search tree, and postorder and preorder traversal Determine the shortest path in Graph

  Ict governance

ICT is defined as the term of Information and communication technologies, it is diverse set of technical tools and resources used by the government agencies to communicate and produce, circulate, store, and manage all information.

  Implementation of memory management

Assignment covers the following eight topics and explore the implementation of memory management, processes and threads.

  Realize business and organizational data storage

Realize business and organizational data storage and fast access times are much more important than they have ever been. Compare and contrast magnetic tapes, magnetic disks, optical discs

  What is the protocol overhead

What are the advantages of using a compiled language over an interpreted one? Under what circumstances would you select to use an interpreted language?

  Implementation of memory management

Paper describes about memory management. How memory is used in executing programs and its critical support for applications.

  Define open and closed loop control systems

Define open and closed loop cotrol systems.Explain difference between time varying and time invariant control system wth suitable example.

  Prepare a proposal to deploy windows server

Prepare a proposal to deploy Windows Server onto an existing network based on the provided scenario.

  Security policy document project

Analyze security requirements and develop a security policy

  Write a procedure that produces independent stack objects

Write a procedure (make-stack) that produces independent stack objects, using a message-passing style, e.g.

  Define a suitable functional unit

Define a suitable functional unit for a comparative study between two different types of paint.

  Calculate yield to maturity and bond prices

Calculate yield to maturity (YTM) and bond prices

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