Problem for C++: Suppose there are 50 lockers in a school, each student is standing in front of his/her locker and all the lockers are closed. Now each student starts to close open lockers or open closed lockers starting from their locker to the last locker.
If this starts from the first student till the last student, how many lockers will remain open and how many will remain closed. Solve this problem using array and print the number of open and closed lockers.
Use only conditions, loops, user-defined functions and arrays. (No pointers or extra stuff)