Write a function called nRandomNumbers( ) to perform the following tasks:

1. Generate N random integers between -250 and 250 (inclusive) and save them in a file called number.txt, (Use the function srand()).
2. Print all the generated integers.
3. Compute and return the average of all the negative integers, and the maximum of all the positive integers
I dont know how to use srand function please help me;
I wrote the code but its gives me error

using namespace std;
void nRandomNumbers()
	int a;


int main ()


	return 0;

Why do you first time posters always leave out the most important information to understanding the problem? The response to the information given:

I wrote the code but its gives me error

That's because you did something wrong.

Don't you think what the error is might be an important piece of information?

Use rand instead of srand. srand is the seed.

int number=250

srand ( (unsigned)time ( NULL ) );
r=rand() % number+1;