Write a program that finds and displays all the odd numbers between 1 and N. The...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Write a program that finds and displays all the "odd numbers" between 1 and N. The value of N is an integer entered by the user and should be a positive value. a) Prompt the user to input a positive integer. b) Ask them to re-enter if it's not a positive value. c) Identify and display the odd values between 1 and N. Print them on the same line separated by a space or tab. d)What's the average of those odd numbers? Compute and display the average as well. Write a program that finds and displays all the "odd numbers" between 1 and N. The value of N is an integer entered by the user and should be a positive value. a) Prompt the user to input a positive integer. b) Ask them to re-enter if it's not a positive value. c) Identify and display the odd values between 1 and N. Print them on the same line separated by a space or tab. d)What's the average of those odd numbers? Compute and display the average as well.
Expert Answer:
Related Book For
Posted Date:
Students also viewed these programming questions
-
Differentiate between and provide examples of voluntary versus involuntary payroll deductions. Why are deductions from employees' earnings classified as liabilities for the employer? What is the...
-
What are the SDGs ? What is their history? How do they support global sustainability agenda?
-
Question 5 (a) Assuming you have completed your master's degree programme and employed as a director in one of the public sector institutions in your country. Generally, as a bureaucrat, if you are...
-
Telstar Limited was incorporated on 2 January 2015. On 3 January 2015, the company ordered plant from Germany at a cost of E1 million. The plant was loaded free on board in Hamburg on 1 March 2015,...
-
In December, Mendoza agreed to buy the broccoli grown on one hundred acres of Willow Glen's one-thousand-acre broccoli farm. The sales contract specied F.O.B. Willow Glen's eld by Falcon Trucking....
-
Cherokee Construction Company changed from the cost-recovery to the percentage-of-completion method of accounting for long-term construction contracts during 2019. For tax purposes, the company...
-
Indicate whether each of the following items, a through \(g\), would be considered a (1) a strategic alliance or (2) another form of an agreement between two parties. a. Agreement between a...
-
At the beginning of 2011, the Healthy Life Food Company purchased equipment for $42 million to be used in the manufacture of a new line of gourmet frozen foods. The equipment was estimated to have a...
-
Shiing Shen Chern's credit card company determines his minimum monthly payment by adding all new interest to 1 % of the outstanding principal. The credit card company charges an interest rate of 0 ....
-
For each of the following three employees calculate gross earnings, CPP contributions, EI premiums, income taxes, and net pay after these statutory withholdings. All employees are in British...
-
The _________ feature is a specialized search box that displays commands in the Office app related to the search term entered. Tell Me Find and Replace Custom Search Custom Styles Track Changes
-
The step response of an overdamped system exhibits a. no oscillations b. oscillations c. overshoot
-
The function Q_sin_taylor uses terms out to \(x^{9}\) and calculates them explicitly for input \(x\). Show via algebraic manipulation that the same truncated series sum can be found using only \(x\)...
-
Fill in the Blank. The Laplace transform of \(f(t)\) is denoted as ___________.
-
Write code fragments to create a two-dimensional array b[][] that is a copy of an existing two-dimensional array a[][], under each of the following assumptions: a. a[][] is square b. a[][] is...
-
What are the tests that could be used in a two-independent-samples t test for proportions?
-
Rental details from operation of two separate rental properties: Property 1 Property 2 Property 3 Gross rental revenue . . . . . . . . . . . . . . . . . . . . . . . . . . . . . $62,000 $52,000...
-
Given that all the choices are true, which one concludes the paragraph with a precise and detailed description that relates to the main topic of the essay? A. NO CHANGE B. Decades, X-ray C. Decades...
-
Define the variables x and y as x = 5.1 and y = 4.2, then evaluate: (a) 3/4 xy 7x/y2 + xy (b) (xy)2- x + y/(x-y)l2 + x + y/2x - y
-
Create the following vector C. c = [1.5 2 2.5 3 3.5 4 4.5 5 9.6 9.1 8.6 8.1 7.6 7.1 6.6 6.1] Then use MATLAB's built-in reshape function and the transpose operation to create the following matrix D...
-
Using the linspace command, create a row vector (assign it to a variable named Nines) with nine elements that are all 9.
-
Why do labor unions exist?
-
Labor union membership has declined in part due to a. a shift in workers from manufacturing to the service sector. b. deregulation in unionized industries. c. increasing global competition. d. all of...
-
If labor unions successfully negotiate wage increases for their members, a. the wages of nonunion workers increase as well. b. the wages in nonunion sectors decrease. c. employment likely falls in...
Study smarter with the SolutionInn App