Need a function
How do i make a function that uses this statement:
cout << "Enter 4 positive number: "<<endl;
for( x = 0; x < north; x++)
cin >> north;
cin >> south;
cin >> east;
cin >> west;
I am not allowed to use assigment statements, only function calls. I don't know how to do that with a statement that isn't mathamatic. I know there is probably a better way to write the above statement, possibly using a loop. But i am really stuck on how to creat a function
Anyone who can help, I would very much appreciate it.
Could you post the exact assignment.
int get_numbs(); //prototype
int get_numbs() // the function
int y = 5;
static int array;
cout << "Enter 4 positive number: "; //tell them what to do
for( x=1; y > x; x++) // run this four times to get numbers
cout << "\n Enter number " << x << " ";
cin >> array[x];
// print out the numbers to the screen
cout << "\n\nNumber 1 Equals "
<< array << " \nNumber 2 Equals "
<< array << " \nNumber 3 Equals "
<< array << " \nNumber 4 Equals "
<< array << "\n\n\n";
return 0; //done, go back to main
int main(void) // the main returns an int and has no arguments
get_numbs(); //call the function get_numbs()
return 0; // send this to the OS, good bye