What is context free grammer of $L = \{w: n_c(w) \ne n_a(w) + n_b(w)\}$
$\Sigma = \{a,b,c\}$. Consider the two cases:


$n_c(w) &gt; n_a(w) + n_b(w)$: The idea is to create one more $c$ for each $a$ or $b$ produce in the word:
\begin{align}
             S_c \rightarrow aS_cS_c | bS_cS_c | c
    \end{align}
$n_c(w) &lt; n_a(w) + n_b(w)$: In this case, we can produce as many $c$'s as $a$ and $b$ combined + 1.
\begin{align}
             S_{ab} \rightarrow aS_{ab} | bS_{ab} | cS_{ab}S_{ab}|a|b
    \end{align}


The grammar for the required language would be : $S \rightarrow S_c | S_{ab}$.