GautamD:
I've declared 'count' as unsigned long and used the 'atol' function to convert 'digits' which is a string into an UL, so why does compiler say I've not used it. Doesn't 'count' now hold an unsigned long int?
It holds a value but you haven't used that value. It's like you've written a note on a piece of paper and then immediately threw it in the trash.