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

  Give difference between testing and debugging

You have just been hired as the testing guru for the CatchAllBugs.com Company. Your first task is to write a set of test cases to debug a small VB program. Unfortunately, you do not have access to the code of program. All you have is the following ..

  Write a program that opens two text files for input

Write a program that opens two text files for input and one for output. The program should concatenate the corresponding lines of the input files.

  Discussing the current risk issues

Primary Task Response: Within the Discussion Board area, write 400-600 words that respond to the following questions with your thoughts, ideas, and comments.

  Discuss the time-domain signal

In the following, the time-domain signal x(t) is given. Use the tables of Fourier transforms and Fourier transform properties to determine the Fourier.

  Create the logic for a program that continuously prompts

Create the logic for a program that continuously prompts the user for a number of dollars until the user enters 0.

  Prove that for all positive real numbers a and b

CSC165H1 Problem Set. Prove the following statements about little-oh, using only the definitions of little-oh and Big-Oh. You may not use any external properties of Big-Oh in this question. Prove that for all positive real numbers a and b, if a

  Identifying physical properties and meaning

According to Kirk (2016), most of your time will be spent work with your data. The four following group actions were mentioned by Kirk (2016).

  Determine standard and protocol that you believe important

Determine one standard and one protocol that you believe to be the most important ones utilized today. Provide a rationale for your response.

  Importance of regular monitoring and maintenance of website

Discuss the importance of regular monitoring and maintenance of a website. What should be checked on a regular basis

  Discuss the legal issues governing the cyber domain

The CIO of the organization you chose read your letter and would like to meet with you to discuss the legal, ethical, and privacy issues governing.

  Which would create a better product

Which would create a better product

  Show how to find out such a seating arrangement

Show how to find out such a seating arrangement and prove that no such seating plan is possible.

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