input: Write a function to calculate the objective function of a linear equation ax + by = c. The function should take in the values of a, b, and c, and return the result of a*x + b*y - c. If the equation is valid, return the result; otherwise, handle the exception and return an appropriate error message.
  
  assert linear_eq(3, 5, 7)==0
  assert linear_eq(-1, 2, 3)==1
  assert linear_eq(0, 0, 0)==0
  assert linear_eq(10, 15, 25)==0
output: def linear_eq(a, b, c):
      try:
          x = c / a
          y = 0
      except ZeroDivisionError:
          try:
              y = c / b
              x = 0
          except ZeroDivisionError:
              if c == 0:
                  return 0
              else:
                  return "Invalid equation"
      return a * x + b * y - c