expected unqualified-id before '{'
Where is this error on my code? Thanks everyone!
#include <iostream>
using std::cout;
using std::endl;
//function prototypes
void findsmallest (int[], int &);
void findsmallest (int scores [], int & min);
int main()
{
//declare variables
int smallest = 0;
int scores[20] = { 90, 54, 23, 75, 67,
89, 99, 100, 34, 99,
97, 76, 73, 72, 56,
73, 72, 65, 86, 90 };
findsmallest(scores, smallest);
return 0;
//call function find smallest
findsmallest (scores, smallest);
cout << "Minimum value in the array is " << smallest << endl;
system ("pause");
return 0;
}
//function definition
void findsmallest(int scores [], int & min);
{
min = scores[0];
int i;
for(i = 0; i < 20; i++)
{
if(scores[i] < min)
{
min = scores[i];
}
}
}
//end display findsmallest
system ("pause");
return 0;