The MATLAB program will ask for a number. Then will display the odd numbers on that...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
The MATLAB program will ask for a number. Then will display the odd numbers on that number, then on the next line will show the even numbers from the number we have input. Then add up all even numbers and multiply all the odd numbers. Note: Use looping statements to perform this task. Sample: Input a number: 15 Odd Number: 1 3 5 7 9 11 13 15 Even Number: 2 4 6 8 10 12 14 Sum of Even Numbers: 56 Product of Odd Numbers: 2027025 The MATLAB program will ask for a number. Then will display the odd numbers on that number, then on the next line will show the even numbers from the number we have input. Then add up all even numbers and multiply all the odd numbers. Note: Use looping statements to perform this task. Sample: Input a number: 15 Odd Number: 1 3 5 7 9 11 13 15 Even Number: 2 4 6 8 10 12 14 Sum of Even Numbers: 56 Product of Odd Numbers: 2027025
Expert Answer:
Answer rating: 100% (QA)
Here is a solution using a for loop in MATLAB Ask the user for a number number inputInput a number I... View the full answer
Related Book For
Income Tax Fundamentals 2013
ISBN: 9781285586618
31st Edition
Authors: Gerald E. Whittenburg, Martha Altus Buller, Steven L Gill
Posted Date:
Students also viewed these programming questions
-
Create a C program that will ask for a grade and display the remarks based on the given grade. The remarks are based on the table below: GRADE RANGE REMARKS 98 - above Excellent 90 - 97 Very Good 80...
-
Price (E) 4 6 8 10 12 Quantity demanded 16 12 8 4 0 Quantity supplied 4 6 8 10 12 (a) Draw the demand and supply curves from the data in Table 1. (b) What is the equilibrium quantity demanded and...
-
Use MATLAB to show that the sum of the infinite series converges to e2. Do this by computing the sum for: (a) n = 5, (b) n = 10, (c) n = 50 For each part create a vector n in which the first element...
-
Under California Law, does a client Carmen Leake have an affirmative defense to inability to pay child support where a parent's inability to pay is due to unwillingness to work, if that parent is...
-
Is a stronger dollar good or bad for America?
-
Based on the accrual basis of accounting, determine when the following independent companies should recognize revenue. 1. Starbucks sells you a $25 gift card for your friends birthday in February....
-
At the end of the current year, Cuppa Joes inventory account balance was \($12,600.\) A physical count of the inventory revealed that inventory on hand totaled \($12,200. What\) amount should Cuppa...
-
During the current year, Ross Corporation purchased a warehouse for $45,000, paid $1,000 dividends, sold land for $7,900, and issued $25,000 of common stock. All of these were cash transactions. Show...
-
Term Structure of Interest Rates.Your investment company's trading system has be-100+20come unstable after a recent update so that your superiors ask you to verify the calculations displayed on the...
-
For the case The WM. Wrigley Jr. Company: Capital Structure, Valuation, and the Cost of Capital(Darden Case: UVAF1482) please answer the following questions and explain your reasoningwhere...
-
Shark Bait, a charter deep sea fishing company, began business on 1/1/2020. A summary of its business transactions are as follows. 1. 1/1/20: Bert and Ernie each invest $69,000 ($138,000 total) into...
-
Your company's Human Resources Division has $1,000,000 in total assets, which is the total capital employed by this division. The Weighted Average Cost of Capital (WACC) is 8%. The tax rate is 20%,...
-
A car moving at 43 km/h skids 16 m with locked brakes. How far will the car skid with locked brakes at 107.5 km/h? Assume that energy loss is due only to sliding friction. m. Answer in units of m....
-
What role does decision framing play in shaping preferences and choices, and how can reframing techniques, such as perspective-taking and scenario analysis, be utilized to broaden decision-makers'...
-
A stock is currently priced at $51.00 and pays a dividend yield of 4.3% per annum. The risk-free rate is 5.7% per annum with continuous compounding. In 12 months, the stock price will be either...
-
A pogo stick has a spring with a force constant of 2.50 x 10' N/m, which can be compressed 16.13 cm. To what maximum height can a child jump on the stick using only the energy in the spring, if the...
-
The drag coefficient of an aircraft can be expressed as: CD = 0.020 + 0.125CZ. It flies at an altitude of 9,000m at a speed of M = 0.85. It has a weight of 111kN and a wing area of 35m. a) In...
-
Show that if A is any m n matrix, then Im A = A and AIn = A.
-
Kent Pham, CPA, is a 45-year-old single taxpayer living at 169 Trendie Street, La Jolla, CA 92037. His Social Security number is 865-68-9635. In 2012, Kent's W-2 as the controller of a local...
-
Clarita is a single taxpayer with two dependent children, ages 10 and 12. Clarita pays $3,000 in qualified child care expenses during the year. If her adjusted gross income (all from wages) for the...
-
During 2012, Palo Fiero purchases the following property for use in his manufacturing business: Palo uses the accelerated depreciation method under MACRS, if available, and does not make the election...
-
For the system methanol (1)-methyl acetate (2), the activity coefficients for components 1 and 2 are represented by where \[ \begin{aligned} \ln \gamma_{1} & =A x_{2}^{2} \quad \text { and } \quad...
-
Deduce the Gibbs-Duhem-Margules equation for a binary solution starting from Raoult's law.
-
The vapour pressure of acetone, acetonitrile and nitromethane can be represented by Antoine equations as \[ \begin{aligned} & \ln P_{1}^{\text {Sat }}=14.3916-\frac{2795.82}{T+230.0} \\ & \ln...
Study smarter with the SolutionInn App