When trying to compile, I am receiving errors which I am assuming are pretty generic and common:

lin_interp.c:21: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
lin_interp.c:100: error: expected '{' at end of input

I am not very familiar with C code, so any help would be greatly appreciated. I am just trying to get the code to work for now. I have created a program similar to this which worked in C++, but the code isn't jiving in C.

Code:
// Lin_Interp.c : Defines the entry point for the console application.
//
#include "PACRXPlc.h"  /* Include file applicable for all targets */
#include "ctkInitCBlock.h"
#include "string.h"
#include "math.h"
#include "stdlib.h"
#include <time.h>
#include <ctype.h>
#include <stdio.h>
/* Constants / #defines  */
// Print-Out on console "XY LIMIT ARRAY"  XYlim    
int GefMain  (T_WORD *Y0,       /* Input Param 1  */
             T_WORD  *Y1,      /* Input Param 2  */
             T_WORD  *Y2,      /* Input Param 3  */
             T_WORD  *X0,      /* Input Param 4  */
             T_WORD  *X1,      /* Input Param 5  */
             T_WORD  *X2,      /* Input Param 6  */
             T_WORD  *Z1)      /* Output Param 7 */

int main (){ 
   label1:
    int i=0,j=0,X0=0,Y0=0,X1=0,Y1=0;
      double X,Y,Fxy=0,Fxy0=0,FxyOld=0,Fxy1=0;
// "Y Axis LIMIT FUNCTION - CORRECCTED Y ARRAY"  TY
      double TY[11]={0,10,20,30,40,50,60,70,80,90,100};
// "X Axis LIMIT FUNCTION - CORRECTED X ARRAY"  TX
      double TX[11]={0,10,20,30,40,50,60,70,80,90,100};
      // "Lin Interp OP LIMIT FUNCTION - Lin Interp LIMIT ARRAY"  XYlim
    double XYlim[11][11]={0.0,10.0,20.0,30.0,40.0,50.0,60.0,70.0,80.0,90.0,100.0,
			  0.0,10.0,20.0,30.0,40.0,50.0,60.0,70.0,80.0,90.0,100.0,
			  0.0,10.0,20.0,30.0,40.0,50.0,60.0,70.0,80.0,90.0,100.0,
			  0.0,10.0,20.0,30.0,40.0,50.0,60.0,70.0,80.0,90.0,100.0,
			  0.0,10.0,20.0,30.0,40.0,50.0,60.0,70.0,80.0,90.0,100.0,
			  0.0,10.0,20.0,30.0,40.0,50.0,60.0,70.0,80.0,90.0,100.0,
			  0.0,10.0,20.0,30.0,40.0,50.0,60.0,70.0,80.0,90.0,100.0,
			  0.0,10.0,20.0,30.0,40.0,50.0,60.0,70.0,80.0,90.0,100.0,
			  0.0,10.0,20.0,30.0,40.0,50.0,60.0,70.0,80.0,90.0,100.0,
			  0.0,10.0,20.0,30.0,40.0,50.0,60.0,70.0,80.0,90.0,100.0,
			  0.0,10.0,20.0,30.0,40.0,50.0,60.0,70.0,80.0,90.0,100.0};
      cout<< "    X0="<<X0<< ".    X1="<<X1<<"   i="<<i<<endl;
     cout<< "    Y0="<<Y0<< ".    Y1="<<Y1<<"   j="<<j<<endl<<endl;

      cout<< "    KGV_X0["<<X0<<"]="<<TX[X0]<< "    KGV_X1["<<X1<<"]="<<TX[X1]<<endl;   
      cout<< "    SPD_Y0["<<Y0<<"]="<<TY[Y0]<<"    SPD_Y1["<<Y1<<"]="<<TY[Y1]<<endl<<endl;

      cout<< "    XYlim["<<X0<<"]["<<Y0<<"]="<<XYlim[X0][Y0]<<endl;
      cout<< "    XYlim["<<X1<<"]["<<Y0<<"]="<<XYlim[X1][Y0]<<endl;
      cout<< "    XYlim["<<X0<<"]["<<Y1<<"]="<<XYlim[X0][Y1]<<endl;
      cout<< "    XYlim["<<X1<<"]["<<Y1<<"]="<<XYlim[X1][Y1]<<endl<<endl;
      //calculate F(X,Y), and print-out on console.
    //Using one equation to calculate F(X,Y).  The problem with this one equation method is if X0 = X1, then most of the equation's products go to zero.
      //To see this problem, enter an known X value like 48.  Then enter a Y value that is not known or on the curve.  Example would be X=48 and Y=92.5
      //The 3-equation result will be the correct value of 9.1815, the single equation result will be the result of X=48 and Y=90 or 8.672
    FxyOld=XYlim[X0][Y0]+((X-TX[X0])/(TX[X1]-TX[X0])*(XYlim[X1][Y0]-XYlim[X0][Y0]))+
            ((Y-TY[Y0])/(TY[Y1]-TY[Y0])*(X-TX[X0])/(TX[X1]-TX[X0])*(XYlim[X1][Y1]-XYlim[X0][Y1]-XYlim[X1][Y0]+XYlim[X0][Y0]));
   //Using 3 equations to calculate F(X,Y).  Using this method prevents the problem that occurs when X0 = X1 and Y0 does not equal Y1.
   Fxy0=XYlim[X0][Y0]+((X-TX[X0])/(TX[X1]-TX[X0])*(XYlim[X1][Y0]-XYlim[X0][Y0]));
   Fxy1=XYlim[X0][Y1]+((X-TX[X0])/(TX[X1]-TX[X0])*(XYlim[X1][Y1]-XYlim[X0][Y1]));
   Fxy=Fxy0+((Y-TY[Y0])/(TY[Y1]-TY[Y0])*(Fxy1-Fxy0));

   cout<< "    Fxy["<<X<<"]["<<Y<<"]= "<<Fxy<<"   (3-equation result)"<<endl<<endl;//Three equation result to screen
   cout<< "    FxyOld["<<X<<"]["<<Y<<"]= "<<FxyOld<<"   (1-equation result)"<<endl<<endl;    //Single equation result to screen
   goto label1;  //Start program over
	for (j=0;j<11;j++){             
        for (i=0;i<11;i++){
         cout<< XYlim[i][j] << " "; //Display the curve
            }
      cout << endl;
      }
      // Input X, ensure it is in the range.
      cout<<endl<< "Please enter X value:";
      cin>>X;     
      while (X >100.0 || X<0.0){
                  cout<<endl<< "Your X value is either greater than 100.0 or smaller than 0.0, Please re-enter again:";
            cin>>X;
            }
      // Input Y, ensure it is in the range.
    cout<<endl<< "Please enter Y value:";
      cin>>Y;
      while (Y >100.0 || Y<0.0){
                  cout<<endl<< "Your Y value is either greater than 100 or smaller than 0, Please re-enter again:";
            cin>>Y;
            }     
      cout<<endl<< "    X="<<X<< ".    Y="<<Y<<endl<<endl;

      //Select the correct X0&Y0, X1&Y1
          for (i=0;i<10;i++){ 
            if (X >= TX[i]) X0=i;
            else break;
      }
      X1=X0+1;

    for (j=0;j<12;j++){ 
            if (Y >= SPD[j]) Y0=j;
            else break;
      }

      return 0;
}