# test - a test program for tcalc

# define decimal point
decimal = 2
# define output format as 'all', effectively outputting all number formats.
# we could also write: output=decimal
output = d
# define global variable
var pi = 3.17

#define first function
func avera(c,d)
{
  var e
  e = (c+d)/2
  return e
}

#define second function
func averb(a,b,c)
{
  var x
  x = (a+b+c)/3
  return x
}

#define third function
func area(r)
{
  var a
  a = pi*r*r
  return a
}

#calculate!
echo "Output from avera():"
avera(4,5)
echo Output from averb():
averb(4,5,6)
echo Output from area():
area(3)

end