Hi

i got syntax error in if statement ,, i checked the line i put { after the condition don't know where the mistake are


1>c:\users\hani\test11\test11\code.cpp(20) : error C2143: syntax error : missing ';' before 'if'

PHP Code:

# include <iostream>
using namespace std;
int seqsearch (int list[],int length,int key);
void main () {
    
int marks [30];
    
int length;
    
int key;

    
cout << " Enter number of students : "<<endl;
    
cin >> length;

    for ( 
int i=0i<lengthi++)
        
cin >> marks[i];

    
cout << " Enter the key : "<<endl;
    
cin >>key;

    
int pos;
    
pos seqsearch marks length key )
        if ( 
pos == -){
            
cout << " the key is not found ";
        }
        else {
            
cout << " the key at position"<<pos<<endl;
        }
    
}

int seqsearch (int list[],int length,int key) {
    for ( 
int i=0i<lengthi++)
        if ( list[
i] == key)
            return 
i;
    return -
1;