(A) Let the number of marbles John had be $x$.
Then the number of marbles Jivanti had $= 45 - x$.
The number of marbles left with John after losing $5$ marbles $= x - 5$.
The number of marbles left with Jivanti after losing $5$ marbles $= (45 - x) - 5 = 40 - x$.
According to the problem,the product of the remaining marbles is $124$:
$(x - 5)(40 - x) = 124$.
Expanding the product:
$40x - x^2 - 200 + 5x = 124$
$-x^2 + 45x - 200 = 124$
Rearranging the terms to form a standard quadratic equation:
$-x^2 + 45x - 200 - 124 = 0$
$-x^2 + 45x - 324 = 0$
Multiplying by $-1$:
$x^2 - 45x + 324 = 0$.
Thus,the number of marbles John had satisfies the quadratic equation $x^2 - 45x + 324 = 0$.