Question: Write a program that ( a ) generates a vector with 2 0 random integer elements with integers between - 1 0 and 1 0
Write a program that a generates a vector with random integer elements with integers between and replaces all the negative integers with random integers between and repeats until all the elements are positive. The program should also count how many times is repeated before all the elements are positive. When done, the program displays the vector and a statement that states how many iterations were needed for generating the vector.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
