I am trying to build the CFG to $\{a^n b^m c^k \mid m=n+k\}$ but does not working.
I tried $S \to aSc$, $S \to S_1$, $S \to \epsilon$, $S_1 \to bS_1c$, $S_1 \to \epsilon$ but it does not work.
I am trying to build the CFG to $\{a^n b^m c^k \mid m=n+k\}$ but does not working.
I tried $S \to aSc$, $S \to S_1$, $S \to \epsilon$, $S_1 \to bS_1c$, $S_1 \to \epsilon$ but it does not work.
Observe that your language can be written as the product of two context-free languages $$ \{a^nb^{n+k}c^k \mid n, k \geqslant 0 \} = \{a^nb^n \mid n \geqslant 0\}\{b^kc^k \mid k \geqslant 0\} $$ which naturally leads to the grammar \begin{align} S &\to S_0S_1 \\ S_0 &\to aS_0b + 1 \\ S_1 &\to bS_1c + 1 \end{align}