mr xipittos,
thank you for being meticulous enough to detect silly errors. i got my program finished and working. but i dont get what you mean by code blocks. you dont have to reply me now
tell me in my answer to next question.
thanks.

other errors include ctr (ctr++) num (num+1) num=0 (num=-1)