Random Generation of five numbers assistance

Hello, I had to write a program that randomly generates five numbers between -10 and 10. It should announce the total of the numbers and the cout of how many are less than zero and how many are zero or greater. So far I have started writing the program but I am possitive im making alot of errors, I just dont know what they are. This is what I wrote.Thanks

#include <cstdlib>
#include <iostream>
#include <ctime>

using namespace std;
int main()
{
srand (time(NULL));
for (int i=0;i<10; i++)

int n1, n2, n3, n4, n5, plusCount, minusCount;

cout<< rand()<<endl;
cout<< rand()<<endl;
cout<< rand()<<endl;
cout<< rand()<<endl;
cout<< rand()<<endl;
}
int getRand;
{
return (rand()%20 -10);
}
void processNumber (int n1, int n2, int n3, int n4, int n5, int &plusCount, int &minusCount,int &sum);//passes whole numbers
{

if (n1 < 0)==(minusCount++)
else if (plusCount++)
}
void displayResults(int n1, int n2, int n3, int n4, int n5, int plusCount, int minusCount, int sum);
{
system("PAUSE");
return EXIT_SUCCESS;
}
Last edited on
Lots going on here. Have you attempted to compile this yet?

Things of note:
-none of your functions have headers.
-if (n1 < 0)==(minusCount++) // Not sure what you're doing here, but this won't compile
-your displayResults function is attempting to return a value as a void
-your functions are never called in the main function - and your variables are never used.
Topic archived. No new replies allowed.