Question: Create a variable num, which stores random integer in the inclusive range from 2 0 to 3 0 . Use the colon operator to create

Create a variable num, which stores random integer in the inclusive range from 20
to 30. Use the colon operator to create a vector myvec that iterates from 5 to num
in steps of 2. Write as many expression as you can that would refer to the last
element in myvec, without assuming that you know how many elements it has.
(i.e., make your expressions general).
Create any vector you like and store in newvec. Write an expression that refers to
only the elements that have even-number subscripts (or even-number index) in
newvec.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!