Question: Write a C++ program that : 1. Allow the user to enter the size of the array such as N. N must be an integer

Write a C++ program that : 1. Allow the user to enter the size of the array such as N. N must be an integer > 1 or 0 to quit the program . 2. Create a vector array of size N x N and populate it with random number of 0s and 1s only. Use a random number generator to generate the 0s and 1s. 3. Display the 2 d vector array. 4. Pass the vector array to a function. The purpose of the to do the following : a. Asks for two integer indices i and j (less or equal to n) or -1 . b. Return the number of nonzero elements of the array that are adjacent to the i-th and j-th element of the array c. repeat steps a and b until -1 is

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!