So I have a program scenario for a postman who carries out an experiment:
1. He has mailboxes numbered 1-150 all of which are 'closed'
2. Starting with mailbox 2, he 'opens' all even-numbered mailboxes, leaving all others 'closed'
3. Next, beginning with mailbox 3,goes on to 'open' every third 'if' its 'closed' and 'if' its 'open' he 'closes' it
4. He repeats step (3) with the 4th,5th...nth mailbox, opening or closing every 4th, 5th...nth mailbox accordingly.
5. display open and closed mailboxes
i need some codes for this problems. i cant finish it because it so difficult. someone there want to help me?