hi , i'm using the Borland C++ builder for programming and i've been trying to resolve this issue as whenever i try to run it, it gives me an error.

This code is supposed to do is if you press on “Accept” button, the entered number will be sent to the array named A1 and it should validate the number and the Accept button will be disabled after you accept five numbers.
If you press on “Exc” button, the lower number in the array A1 will be found and it will be displayed in the memo.

And it has one one editbox named Edit1 that holds the input number and one memo named Memo1 and two buttons named Accept and Exc. And i already have declared array of 5 integers initialized by zeros.



Code:
int num;
int A1[5]= {0, 0, 0, 0, 0 };
int i;
int j;
int count;


void __fastcall TForm1::AcceptClick(TObject *Sender)
{
           num=Edit1->Text.ToInt();   
       A1[i] = num;  
       count++; 


if (count==5)  
        Accept->Enabled=false;   




}
//---------------------------------------------------------------------------


void __fastcall TForm1::ExcClick(TObject *Sender)


{
min=A1[0] 
            for(int j=1; j<5; j++)  
            {
                   if(A1[j] < min)   
            min= A1[j]; 
            }
    Memo1->Lines->Add(AnsiString(num));  


}
Your help would be highly appreciated !