Rules related to anunasiks

Inside words:
If an anunasik is follwed by: क ख ग घ use ङ्
(e.g. अङ्ग )
If an anunasik is follwed by: च छ ज झ use ञ्
(e.g. अञ्जली )
If an anunasik is follwed by: ट ठ ड ढ use ण्
(e.g. खण्ड )
If an anunasik is follwed by: त थ द ध use न्
(e.g. अजन्त )
If an anunasik is follwed by: प फ ब भ use म्
(e.g. लम्ब )
If an anunasik is follwed by: य व र ल ष श स ह use ं (e.g. सिंह )

At the end of word:
If an anunasic ends a sentence, or if it ends a word and the folowing starts with a vowel, use: म्
(e.g. फलम् अस्ति )
otherwise use: ं
(e.g. फलं पतति )