Question: Problem (2): Write a program that asks the user to input a vector of integers of arbitrary length. Then, using a for-end loop, the program

 Problem (2): Write a program that asks the user to input

Problem (2): Write a program that asks the user to input a vector of integers of arbitrary length. Then, using a for-end loop, the program examines each element of the vector. If the element is positive, its value is doubled. If the element is negative, its value is tripled. The program displays the vector that was entered and the modified vector. Execute the program, and when the program ask the user to input a vector type randi (I-10 20], 1, 19). This creates a 19-element vector with random integers between -10 and 20

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 Databases Questions!