Authough my complier (Bloodshes dev-C++) has found a parse error before else I cannot work out how to fix this
Code:
    
int main(int argc, char *argv[])
{
  while (main !=0)
  {
    long samsiz;
    long varsiz;
    cout<< "to begin press:" << endl;
    cout<< "1 for a rectangle"<<endl<<"0 for quit"<<endl;
    cin>> type;
    if (type == 1);
    {
      cout<<"You have selected rectangle" << endl;
      cout<<"What is the fixed length?" << endl;
      cin>>samsiz;
      if (samsiz == 5);
      {
        cout<<"you have selected 5" << endl;
        cout<<"what is the variable size"<<endl;
        cin>>varsiz;
        varsiz=varsiz-1;
        cout<<"The difference between diagnal corners is " << varsiz*40<<endl;
      }
    }
    else
    {
     return 0;
    }
   }
 }