After the first $\texttt{fork()}$, the parent and child have separate copies of $\texttt{a}$.
Both processes execute the first increment, making their private value of $\texttt{a}$ equal to $1$.
In the parent:
$\texttt{a++;}$
Therefore, the parent prints $2$.
The first child executes another $\texttt{fork()}$. Both the child and the newly created grandchild then execute:
$\texttt{a++;}$
Their private value also becomes $2$.
Hence, every process prints $2$, and the largest value printed is $2$.
Answer : B