subject
Engineering, 07.04.2020 18:40 remomy05

Write a function sumsteps2 that calculates and returns the sum of 1 to n in steps of 2, where n is an argument passed to the function. For example, if 11 is passed, it will return 1 + 3+5+7+9+11. Do this using a for loop. Calling the function will look like this: >> sumsteps2(11) ans 36 For example: Test assert (sumsteps2 (11) = 36) assert (sumsteps2 (23) 144) assert ( sumsteps2(57) = 841) assert(sumsteps2(3)4) assert (sumsteps2(1001) 251001)

ansver
Answers: 3

Another question on Engineering

question
Engineering, 03.07.2019 14:10
Explain the difference laminar and turbulent flow. explain it with the shear stress and the velocity profiles.
Answers: 1
question
Engineering, 03.07.2019 14:10
When at a point two solid phase changes to one solid phase on cooling then it is known as a) eutectoid point b) eutectic point c) peritectic point d) peritectoid point
Answers: 3
question
Engineering, 04.07.2019 18:10
Shafts are machine elements that are used to a) carry axial loads b) direct shear loads c) transmit power d) rotate at constant speed e) none of the above circular and square shafts subjected to the same torque under the same circum behave a) the same way b) almost the same way
Answers: 2
question
Engineering, 04.07.2019 18:10
What are the two (02) benefits, which may result from a successful implementation of preventive maintenance (pm) program in an organization? (clo3)a)- lean manufacturing b)-overlapping responsibilities c)-the planner is not qualified d)-accurate contractor information e)-reduction in equipment redundancies f)-accurate stores information
Answers: 3
You know the right answer?
Write a function sumsteps2 that calculates and returns the sum of 1 to n in steps of 2, where n is a...
Questions
question
Mathematics, 19.12.2019 06:31
question
Mathematics, 19.12.2019 06:31
question
Biology, 19.12.2019 06:31
question
Mathematics, 19.12.2019 06:31
Questions on the website: 13722360