Resideo Interview Question

Manipulate given 8 logic switches according to the given situations. Write a code for it.