Find Locker Status
There are "N" closed lockers numbered 1 to N. A person begins by opening all "N" lockers. Next, he closes every second locker. Then he goes to every third locker and closes it if it is open or opens it if it is closed (toggles the locker open/close status).
He continues to toggle every "K"th locker on pass number K.He completes his activity when pass N (that is till K equals N) is reached.
The program should print the open/close status of a locker when the locker number L is provided as input.
The program should print "open" if the locker is open. It should print "closed" is locker is closed.
Two string input values will be passed as input.
First string will be N - the number of lockers.
Second string will be L - the number of the locker for which status is to be printed.
Output format:The output is a single line whose value is either "open" or "closed"
public class Hello
public static void main(String args)
Scanner sc=new Scanner(System.in);
int num=new int[n];