Comments

First of all, the functions must be defined outside main(). Second, the function parameters are copies of the ones in main(), so they don't necessarily need to have the same name, but they need to have some kind of name. For convenience, I picked the same names in the example below, but you could as well have named them a1, a2, a3 etc.

Also, you compare the variables in the wrong way. An if-statement contains no built-in intelligence at all, you have to compare all variables one by one. Meaning that will be a long tiresome code... it is much easier to do this when you know how to handle arrays.

: First of all, the functions must be defined outside main(). Second, : the function parameters are copies of the ones in main(), so they : don't necessarily need to have the same name, but they need to have : some kind of name. For convenience, I picked the same names in the : example below, but you could as well have named them a1, a2, a3 etc.: : Also, you compare the variables in the wrong way. An if-statement : contains no built-in intelligence at all, you have to compare all : variables one by one. Meaning that will be a long tiresome code... : it is much easier to do this when you know how to handle arrays.: : You should have something like this:: : : [code]: void findLowest (int acc1, int acc2, int acc3, int acc4, int acc5);: : int main(): {: int acc1, acc2, acc3, acc4, acc5;: ...: findLowest(acc1, acc2, acc3, acc4, acc5);: ...: }: : void findLowest (int acc1, int acc2, int acc3, int acc4, int acc5): {: if(acc1 < acc2 && acc1 < acc3 && acc1 < acc4 && acc1 < acc5): {: cout << ...: }: else if(acc2 < acc1 && ....): {: }: : }[/code]:

So, what happens with the getNum? I am supposed to use that to get the number of accidents and then output with the findLowest...