Question: c# Generate an array of 20 random integers from zero to nine. Search for the first occurrence, if any, of the number 7, and report

c#

Generate an array of 20 random integers from zero to nine. Search for the first occurrence, if any, of the number 7, and report its position in the array.

Hint: Random r = new Random();

Output should look similar to:

c# Generate an array of 20 random integers from zero to nine.

Repeat the computation of part a 1000 times, and for each position in the array, report the number of times that the first occurrence of a 7 in the array is at that position.

Your output should be similar to the screenshot below:

Search for the first occurrence, if any, of the number 7, and

he first seven occurs at index 1 4,7,4,3,8,3,3,4,1,6,7,3,3,9,1,3,3,2,8,7)

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!