Let $C$ be an irreducible curve on a surface $S$. We have the classical exact sequence $0\rightarrow\mathcal O_S(-C)\rightarrow\mathcal O_S\rightarrow\mathcal O_C\rightarrow 0$. Why can we deduce that $\chi(\mathcal O_C)=1-g(C)=\chi(\mathcal O_S)-\chi(\mathcal O_S(-C))$? I know that by definition $g(C)=h^1(C,\mathcal O_C)$.
Thank you very much!
Let $$0 \rightarrow \mathcal{F}' \rightarrow \mathcal{F} \rightarrow \mathcal{F}'' \rightarrow 0$$ be a short exact sequence of coherent $\mathcal{O}_S$-modules. The associated long exact sequence of cohomology
$$0 \rightarrow H^0(X,\mathcal{F}') \rightarrow H^0(X,\mathcal{F}) \rightarrow H^0(X,\mathcal{F}'') \rightarrow H^1(X,\mathcal{F}') \rightarrow H^1(X,\mathcal{F}) \rightarrow \,\,...$$ consists of finite-dimensional vector spaces over the ground field $k$, which allows us to apply the rank-nullity theorem and obtain $$0 = h^0(\mathcal{F}') - h^0(\mathcal{F}) + h^0(\mathcal{F}'') - h^1(\mathcal{F}') + h^1(\mathcal{F}) - h^1(\mathcal{F}'') \;+ \,\,...$$ Now just use the definition of the euler characteristic to get $$0 = \chi(\mathcal{F}') - \chi(\mathcal{F}) + \chi(\mathcal{F}''),$$ i.e. $$\chi(\mathcal{F}) = \chi(\mathcal{F}') + \chi(\mathcal{F}'').$$