
program FactorialRec {

Declarations

	a , b:= 5 -> Integer;

	subprogram factorialRec (x -> integer) :: integer
	{
	  Declarations  
		res -> integer;

	  Statements
		if ( x == 0) then
		   { res = 1;
		   }
		else
		   {
		     res = x * factorialRec (x - 1); 
		  }
	  return res;
	}

Statements

	a = factorialRec(b);
}
