borland c++

heloo,I am working on calculator program with borland builder,but I have got a problem for displaying the result of calcul operation.

void TForm1::calcul(char operation)
{
if((operation==' ')&&(Edit1->Text.Length()>0))
{
x=StrToFloat(Edit1->Text);
Edit1->Clear();
result=true;
operation='+';operation='-';operation='*';operation='/';
}
if(operation!=' ')
{ y=StrToFloat(Edit1->Text);
pr_y++;
switch (operation)
{ case'+':z=x+y; break;
case'-':z=x-y; break;
case'*':z=x*y; break;
case'/':z=x/y; break;
}
Edit1->Text=z;
x=y=pr_x=pr_x1=pr_y=virgule=0;
resultat++;
x=z;

if(operation=='=')
{operation='=';
result=true;}
else
operation='+';
result=false;
}
}
Last edited on
Topic archived. No new replies allowed.