Need I remind you of your first post?
you didn't offer up any code that you had already written. consequently, there was no way to know on what line(s) you were having trouble. you simply said "Write a C program..." In my book, that constitutes asking to have it done for you, and apparently abachler agrees. We want to see YOUR code, and see where YOU are having problems. If you point out the area of YOUR code that is giving you trouble, we will be more than happy to assist you, as long as you ask smart questions. please click on the link and read the article.