Why I can't get this program complied ? I am geting " 20 expected unqualified-id before '{' token "
#include <iostream>
using namespace std ;
int answer(int num[] ,int num );
main ()
{
int ary[10] ;
cout << " Please Enter 10 integer values" << endl ;
for ( int i = 0 ; i <= 9 ; i++ )
{
cout << " Enter the value of " << i + 1 << " array element : " ;
cin >> ary[i] ;
int total = answer ( ary,i );
}
}
int answer (int num[] ,int num );
{
int sum = 0 ;
for ( int i = 0 ; i < 10 ; i ++ )
{
sum+ = num [i] ;
}
return sum ;
}