Let Ankita's age be \( a \) and Nikita's age be \( n \).
From the given conditions:
\[
a \times n = 240 \quad \text{and} \quad 2n = a + 4
\]
From the second equation, express \( a \) in terms of \( n \):
\[
a = 2n - 4
\]
Substitute this into the first equation:
\[
(2n - 4) \times n = 240
\]
Expanding and simplifying:
\[
2n^2 - 4n = 240 \quad \Rightarrow \quad 2n^2 - 4n - 240 = 0
\]
Dividing by 2:
\[
n^2 - 2n - 120 = 0
\]
Solving this quadratic equation:
\[
n = \frac{2 \pm \sqrt{2^2 - 4(1)(-120)}}{2(1)} = \frac{2 \pm \sqrt{4 + 480}}{2} = \frac{2 \pm \sqrt{484}}{2}
\]
\[
n = \frac{2 \pm 22}{2}
\]
Thus, \( n = 12 \) or \( n = 15 \).
Therefore, Nikita's age is 12.