the problem is:
Suppose that a row of mailboxes is numbered from 1 to 150 and that beginning with mailbox 2, we open the doors of all the even-numbered mailboxes. Next, beginning with mailbox 3, we go to every third mailbox, opening its door if it is closed and closing it if it is open. we repeat this procedure with every fourth mailbox, then every fifth, and so on. write a program to determine which mailboxes will be closed when this procedure is completed.
I'm using Fortran 77, and I need to use arrays to solve this.
Thanks in advance.
Suppose that a row of mailboxes is numbered from 1 to 150 and that beginning with mailbox 2, we open the doors of all the even-numbered mailboxes. Next, beginning with mailbox 3, we go to every third mailbox, opening its door if it is closed and closing it if it is open. we repeat this procedure with every fourth mailbox, then every fifth, and so on. write a program to determine which mailboxes will be closed when this procedure is completed.
I'm using Fortran 77, and I need to use arrays to solve this.
Thanks in advance.