change
while ((action != 1) || (action != 2) || (action != 3) || (action != 4)); // (1)
to
while ((action != 1) && (action != 2) && (action != 3) && (action != 4)); // (2)
Analysis:
if action == 1
(1) will evaluate to
while(false || true || true || true)
=>
while (true)
(2) will evaluate to
while(false && true && true && true)
=>
while (false)