Compare your "newline" character in this piece of code:


if (c == '/n')

... to the "newline" character in this piece of code:


printf("%d\n",nl);