Alternate operation of two motors depending on state of pressure switch.

Its showing error of 'alt was not declared in this scope'

Can you please tell me how to define it?

The easiest way would be to declare alt as a global boolean variable as suggested in reply #14