Question #49712

Write a function called nRandomNumbers( ) that

Generates N random integers between -250 and 250 (inclusive) and saves them in a file

called number.txt, (Use the function srand()).

Prints all the generated integers.

Finds the average of all the negative integers, and the maximum of all the positive

integers.

Returns the the average.

Then, write a main program that

Prompts the user to input the value of N.

Calls the function nRandomNumbers( ).

Prints the average of all the negative integers.

Generates N random integers between -250 and 250 (inclusive) and saves them in a file

called number.txt, (Use the function srand()).

Prints all the generated integers.

Finds the average of all the negative integers, and the maximum of all the positive

integers.

Returns the the average.

Then, write a main program that

Prompts the user to input the value of N.

Calls the function nRandomNumbers( ).

Prints the average of all the negative integers.

Expert's answer

``

## Comments

## Leave a comment